Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }