示例#1
0
 public static ProfessionalServiceProviderDto ToDto(this ProfessionalServiceProvider professionalServiceProvider)
 => new ProfessionalServiceProviderDto
 {
     ProfessionalServiceProviderId = professionalServiceProvider.ProfessionalServiceProviderId,
     FullName = professionalServiceProvider.FullName,
     Title    = professionalServiceProvider.Title,
     ImageUrl = professionalServiceProvider.ImageUrl,
     Version  = professionalServiceProvider.Version
 };
示例#2
0
            public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
            {
                var professionalServiceProvider = await _context.ProfessionalServiceProviders.FindAsync(request.ProfessionalServiceProvider.ProfessionalServiceProviderId);

                if (professionalServiceProvider == null)
                {
                    professionalServiceProvider = new ProfessionalServiceProvider();
                    _context.ProfessionalServiceProviders.Add(professionalServiceProvider);
                }

                professionalServiceProvider.FullName = request.ProfessionalServiceProvider.FullName;

                await _context.SaveChangesAsync(cancellationToken);

                return(new Response()
                {
                    ProfessionalServiceProviderId = professionalServiceProvider.ProfessionalServiceProviderId
                });
            }