示例#1
0
        public Groups DeleteUser(string userID, string groupId)
        {
            Groups groups = this.GetById(groupId);

            if (groups.ListUser.Any(x => x.Id == userID))
            {
                webBackend.Models.User.User users = _users.Find(u => u.Id == userID).FirstOrDefault();
                groups.ListUser.Remove(users);
                this.Update(groups.Id, groups);
                return(groups);
            }
            return(null);
        }
示例#2
0
        public Groups InsertUser(string UserId, string GroupId)
        {
            Groups groups = this.GetById(GroupId);

            if (!groups.ListUser.Any(x => x.Id == UserId))
            {
                webBackend.Models.User.User users = _users.Find(u => u.Id == UserId).FirstOrDefault();
                groups.ListUser.Add(users);
                this.Update(groups.Id, groups);
                return(groups);
            }
            return(null);
        }