Ejemplo n.º 1
0
        public async Task <IEnumerable <GroupSubSearchModel> > GetGroupsByProjectIdAsync(int projectId)
        {
            var queryData = _context.Groups.Where(g => g.ProjectId == projectId);
            var result    = QueryOperate <Group> .Execute(queryData);

            var groups = await result.ToListAsync();

            var groupsSearch = GroupOperator.SetGroupSubSearchModel(groups);

            return(groupsSearch);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <GroupSubSearchModel> > GetGroupsByUserId(string userId)
        {
            var queryData = _context.UserGroups
                            .Where(u => u.UserId == userId)
                            .Select(u => u.Group);

            var result = QueryOperate <Group> .Execute(queryData);

            var groups = await result.ToListAsync();

            var groupsSearch = GroupOperator.SetGroupSubSearchModel(groups);

            return(groupsSearch);
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <GroupSubSearchModel> > GetGroupsByLocationIdAsync(int locationId)
        {
            var queryData = _context.GroupLocations
                            .Where(gl => gl.LocationId == locationId)
                            .Select(gl => gl.Group);

            var result = QueryOperate <Group> .Execute(queryData);

            var groups = await result.ToListAsync();

            var groupsSearch = GroupOperator.SetGroupSubSearchModel(groups);

            return(groupsSearch);
        }