Beispiel #1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Category = CategoryApiModel.FromCategory(await _context.Categories.FindAsync(request.Id))
     });
 }
Beispiel #2
0
            public async Task <Response> Handle(Request request)
            {
                var categories = await _context.Categories
                                 .Where(x => x.IsDeleted == false)
                                 .ToListAsync();

                return(new Response()
                {
                    Categories = categories.Select(x => CategoryApiModel.FromCategory(x)).ToList()
                });
            }