public async Task <GetCarouselByIdResponse> Handle(GetCarouselByIdRequest request) { return(new GetCarouselByIdResponse() { Carousel = CarouselApiModel.FromCarousel(await _context.Carousels .Include(x => x.Tenant) .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId)) }); }
public async Task <GetCarouselsResponse> Handle(GetCarouselsRequest request) { var carousels = await _context.Carousels .Include(x => x.Tenant) .Where(x => x.Tenant.UniqueId == request.TenantUniqueId) .ToListAsync(); return(new GetCarouselsResponse() { Carousels = carousels.Select(x => CarouselApiModel.FromCarousel(x)).ToList() }); }