Ejemplo n.º 1
0
        private object GetUserGroupStateForSerialization(UserGroupState state)
        {
            var minState = new
            {
                Id   = state.Id,
                Name = state.Name
            };

            return(minState);
        }
Ejemplo n.º 2
0
        public ActionResult GetActiveUserGroups()
        {
            UserGroupState          activeState = _repository.GetSingle <UserGroupState>(ugs => ugs.Name == "Active");
            IEnumerable <UserGroup> groups      = _repository.Get <UserGroup>(ug => ug.UserGroupStateId == activeState.Id);
            var minGroups = new ArrayList();

            foreach (var group in groups)
            {
                minGroups.Add(GetUserGroupForSerialization(group));
            }

            return(Json(minGroups, JsonRequestBehavior.AllowGet));
        }