コード例 #1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Video = VideoApiModel.FromVideo(await _context.Videos
                                         .Include(x => x.Tenant)
                                         .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
コード例 #2
0
            public async Task <Response> Handle(Request request)
            {
                var videos = await _context.Videos
                             .Include(x => x.Tenant)
                             .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                             .ToListAsync();

                return(new Response()
                {
                    Videos = videos.Select(x => VideoApiModel.FromVideo(x)).ToList()
                });
            }