/// <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); }
/// <summary> /// Gets list of questioneers for given {communityid} /// </summary> /// <param name="communityid"></param> /// <returns></returns> public IEnumerable <Questioneer> GetQuestioneers(int communityid) { return(Questioneer.Find(x => x.CommunityId == communityid && !x.Deleted)); }