コード例 #1
0
ファイル: ForumRepository.cs プロジェクト: otac0n/lanlordz
        public ForumRepository(LanLordzDataContext db, ICacheManager dataCache, ConfigurationRepository config, SecurityRepository security)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (dataCache == null)
            {
                throw new ArgumentNullException("dataCache");
            }

            if (security == null)
            {
                throw new ArgumentNullException("security");
            }

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            this.db        = db;
            this.dataCache = dataCache;
            this.security  = security;
            this.config    = config;
        }
コード例 #2
0
 protected void Session_Start()
 {
     using (var db = new LanLordzDataContext())
     {
         lock (syncRoot)
         {
             db.ExecuteCommand("UPDATE dbo.Configuration SET Value = cast(Value as bigint) + 1 WHERE Property = 'Visitors'");
         }
     }
 }
コード例 #3
0
        public ConfigurationRepository(LanLordzDataContext db, ICacheManager dataCache)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            this.dataCache = dataCache;
            this.db        = db;

            this.LoadConfiguration();
        }
コード例 #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.config != null)
                {
                    this.config = null;
                }

                if (this.db != null)
                {
                    this.db = null;
                }
            }
        }
コード例 #5
0
ファイル: PollRepository.cs プロジェクト: otac0n/lanlordz
        public PollRepository(LanLordzDataContext db, ICacheManager dataCache, ConfigurationRepository config)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (dataCache == null)
            {
                throw new ArgumentNullException("dataCache");
            }

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            this.db        = db;
            this.dataCache = dataCache;
            this.config    = config;
        }