public async Task <GetCarouselItemByIdResponse> Handle(GetCarouselItemByIdRequest request) { return(new GetCarouselItemByIdResponse() { CarouselItem = CarouselItemApiModel.FromCarouselItem(await _context.CarouselItems .Include(x => x.Tenant) .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId)) }); }
public async Task <GetCarouselItemsResponse> Handle(GetCarouselItemsRequest request) { var carouselItems = await _context.CarouselItems .Include(x => x.Tenant) .Where(x => x.Tenant.UniqueId == request.TenantUniqueId) .ToListAsync(); return(new GetCarouselItemsResponse() { CarouselItems = carouselItems.Select(x => CarouselItemApiModel.FromCarouselItem(x)).ToList() }); }