public static List <GroupViewModel> GetAllGroups() { List <GroupViewModel> groups = new List <GroupViewModel>(); List <Group> groupList = GroupDB.GetAllGroups(); groupList.ForEach(g => groups.Add(new GroupViewModel(g.ID, g.Name, g.CreatedDate, g.Receviers.Select(r => r.UserName).ToList()))); return(groups); }
public ActionResult GetGroupsNamesList() { var groups = _groupManager.GetAllGroups(); var namesList = groups.Select(u => new GroupNameViewModel { GroupId = u.Id.ToString(), Name = u.Name }); return(Json(namesList, JsonRequestBehavior.AllowGet)); }
public SearchGroups() { _groupsManeger = new GroupDB(new Settings()); _allGroups = _groupsManeger.GetAllGroups(); }