public async Task <IReadOnlyCollection <Group> > GetForOrganization(int organizationId) { var groups = await GroupsWithRelatedData .Where(group => group.OrganizationId == organizationId) .ToListAsync(); return(groups); }
public async Task <Group> Get(int groupId) { var group = await GroupsWithRelatedData.FirstOrDefaultAsync(g => g.Id == groupId); if (group == default) { throw new GroupNotFound(groupId, DateTimeOffset.UtcNow).ToException(); } return(group); }