示例#1
0
        public async Task <List <GroupView> > getGroups([FromUri] string username)
        {
            var skip = HttpUtility.ParseQueryString(Request.RequestUri.Query).Get("skip");
            var take = HttpUtility.ParseQueryString(Request.RequestUri.Query).Get("take");

            List <Models.Group> groups = await mGroupsRepo.getGroups(username, skip, take);

            List <GroupView> groupsView = new List <GroupView>();

            foreach (Models.Group group in groups)
            {
                groupsView.Add(new GroupView {
                    groupName = group.name, groupAdmin = group.mOwner.username, linked = group.mIsLinked
                });
            }

            return(groupsView);
        }