public async Task <GetEpicByIdResponse> Handle(GetEpicByIdRequest request) { return(new GetEpicByIdResponse() { Epic = EpicApiModel.FromEpic(await _context.Epics .Include(x => x.Stories) .Include(x => x.Product) .SingleAsync(x => x.Id == request.Id)) }); }
public async Task <GetEpicsResponse> Handle(GetEpicsRequest request) { var epics = await _context.Epics .Include(x => x.Stories) .Include(x => x.Product) .Where(x => x.TenantId == request.TenantId) .ToListAsync(); return(new GetEpicsResponse() { Epics = epics.Select(x => EpicApiModel.FromEpic(x)).ToList() }); }