public object ActiveRaids(long CommunityId) { Community community; if (Community.FindCommunityById(CommunityId, out community)) { return(community.RaidRunning().Select(x => new { Raid = x, RaidInfo = x.RaidInfo() })); } else { throw new Exception("Community not found."); } }
/// <summary> /// Adds a new questioneer for given {communityid} with {name} and {description}, added by {user} /// </summary> /// <param name="communityid"></param> /// <param name="title"></param> /// <param name="description"></param> /// <param name="User"></param> /// <returns></returns> public Questioneer AddQuestioneer(int communityid, string title, string description, User User) { Questioneer questioneer; Community community; if (!Community.FindCommunityById(communityid, out community)) { throw new Exception(string.Format("Community by id: {0} could not be found.", communityid)); } else { questioneer = new Questioneer(community, title, description); questioneer.Save(User); } return(questioneer); }