public async Task <Response> Handle(Request request) { return(new Response() { Gallery = GalleryApiModel.FromGallery(await _context.Galleries .Include(x => x.Tenant) .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId)) }); }
public async Task <Response> Handle(Request request) { var gallerys = await _context.Galleries .Include(x => x.Tenant) .Where(x => x.Tenant.UniqueId == request.TenantUniqueId) .ToListAsync(); return(new Response() { Galleries = gallerys.Select(x => GalleryApiModel.FromGallery(x)).ToList() }); }