public Community AddCommunity(string name, string description, int gameid, User User) { Community community = null; Game game; if (!Game.TryGetGame(gameid, out game)) { throw new Exception(string.Format("Could not find game by id: {0}", gameid)); } else { if (Community.TryFindCommunity(name, game, out community)) { throw new Exception(string.Format("Community already exist with same name: {0}", name)); } else { community = new Community(name, description, game); community.Save(User); community.AddMember(User, System); } } return(community); }