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

            return(groups);
        }
Ejemplo 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);
        }