private int GetForumId(string forumName) { Forum forum; try { using (NightCapDBContext nightCapDBContext = new NightCapDBContext()) { forum = nightCapDBContext.Forums.Where <Forum>(f => f.Title == forumName).SingleOrDefault(); } } catch (SqlException) { throw; } return(forum.ID); }
private List <Moderator> GetModerators(string forumName) { List <Moderator> moderators; try { using (NightCapDBContext nightCapDBContext = new NightCapDBContext()) { moderators = nightCapDBContext.Moderators.Where(m => m.ForumName == forumName).ToList(); } } catch (SqlException) { throw; } return(moderators); }