コード例 #1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Category = CategoryApiModel.FromCategory(await _context.Categories.FindAsync(request.Id))
     });
 }
コード例 #2
0
ファイル: GetCategoriesQuery.cs プロジェクト: cDoru/backlog
            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()
                });
            }