Esempio n. 1
0
        public async Task <IReadOnlyCollection <Group> > GetForOrganization(int organizationId)
        {
            var groups = await GroupsWithRelatedData
                         .Where(group => group.OrganizationId == organizationId)
                         .ToListAsync();

            return(groups);
        }
Esempio n. 2
0
        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);
        }