public static ProfessionalServiceProviderDto ToDto(this ProfessionalServiceProvider professionalServiceProvider) => new ProfessionalServiceProviderDto { ProfessionalServiceProviderId = professionalServiceProvider.ProfessionalServiceProviderId, FullName = professionalServiceProvider.FullName, Title = professionalServiceProvider.Title, ImageUrl = professionalServiceProvider.ImageUrl, Version = professionalServiceProvider.Version };
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 }); }