public async Task <Response> Handle(Request request) { return(new Response() { Category = CategoryApiModel.FromCategory(await _context.Categories.FindAsync(request.Id)) }); }
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() }); }