//-------------------------------------------------------------------------- public Group AddGroup(string group) { Group resultGroup = new Group() { Name = group }; GroupsDao.Insert(ref resultGroup); return(resultGroup); }
//-------------------------------------------------------------------------- private Group Insert(string name) { List <Group> groups = GroupsDao.Query(name); if (groups.Count > 0) { throw new Exception("a group with this name already exists!"); } // check we have the minimal set of meta data Group group = new Group() { Name = name }; GroupsDao.Insert(ref group); _groupCache[group.Id] = group; return(group); }