Exemple #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         ServiceProviders = await _context.ServiceProviders.Select(x => ServiceProviderApiModel.FromServiceProvider(x)).ToListAsync()
     });
 }
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         ServiceProvider = ServiceProviderApiModel.FromServiceProvider(await _context.ServiceProviders.FindAsync(request.Id))
     });
 }
        public static ServiceProviderApiModel FromServiceProvider(ServiceProvider serviceProvider)
        {
            var model = new ServiceProviderApiModel();

            model.ServiceProviderId = serviceProvider.ServiceProviderId;
            model.Name = serviceProvider.Name;
            return(model);
        }