Ejemplo n.º 1
0
 /// <summary>
 /// 移除缓存
 /// </summary>
 /// <param name="keys">缓存键集</param>
 public static void RemoveRange(IEnumerable <string> keys)
 {
     using (ICacheAdapter cacheAdapter = (ICacheAdapter)Activator.CreateInstance(_CacheImplType))
     {
         cacheAdapter.RemoveRange(keys);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 移除缓存
 /// </summary>
 /// <param name="key">键</param>
 public static void Remove(string key)
 {
     using (ICacheAdapter cacheAdapter = (ICacheAdapter)Activator.CreateInstance(_CacheImplType))
     {
         cacheAdapter.Remove(key);
     }
 }
Ejemplo n.º 3
0
        private SqlServerDataSource(string name, SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings, SqlServerMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary <Type, object> extensionCache) : base(settings)
        {
            if (connectionStringBuilder == null)
            {
                throw new ArgumentNullException("connectionStringBuilder", "connectionStringBuilder is null.");
            }

            m_ConnectionBuilder = connectionStringBuilder;
            if (string.IsNullOrEmpty(name))
            {
                Name = m_ConnectionBuilder.InitialCatalog ?? m_ConnectionBuilder.DataSource;
            }
            else
            {
                Name = name;
            }

            m_DatabaseMetadata = databaseMetadata;

            if (settings != null)
            {
                XactAbort  = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }
            m_ExtensionCache = extensionCache;
            m_Cache          = cache;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new data source with the provided cache.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <returns></returns>
        public MySqlDataSource WithCache(ICacheAdapter cache)
        {
            var result = WithSettings(null);

            result.m_Cache = cache;
            return(result);
        }
 internal GenericDbDataSource(string name, DbConnectionStringBuilder connectionStringBuilder, DataSourceSettings settings = null) : base(settings)
 {
     m_ConnectionBuilder = connectionStringBuilder ?? throw new ArgumentNullException(nameof(connectionStringBuilder));
     Name             = name;
     m_ExtensionCache = new ConcurrentDictionary <Type, object>();
     m_Cache          = DefaultCache;
 }
Ejemplo n.º 6
0
 public GameModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response)
     : base(appCache, session, response)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseAppService"/> class.
 /// </summary>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public BaseAppService(IObjectMapperAdapter objectMapper, ICacheAdapter cacheService, IExceptionManagerAdapter exceptionManager, ILoggingServiceAdapter loggingService)
 {
     this.ObjectMapper     = objectMapper;
     this.CacheService     = cacheService;
     this.ExceptionManager = exceptionManager;
     this.LoggingService   = loggingService;
 }
Ejemplo n.º 8
0
 public AccountModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response) :
     base(appCache, session, response)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CourseModuleAppService"/> class.
 /// </summary>
 /// <param name="courseManager">The course manager.</param>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public CourseModuleAppService(
     ICourseDomainService courseManager,
     IModuleDomainService moduleManager,
     IModuleQuizDomainService moduleQuizManager,
     IDepartmentDomainService departmentManager,
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService,
     ICourseRegistrationDomainService courseRegistrationManager,
     IQuizDomainService quizManager,
     IAssignmentDomainService assignmentManager,
     ISubmissionDomainService submissionManager,
     IStudentDomainService studentManager)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
     this.CourseManager             = courseManager;
     this.ModuleManager             = moduleManager;
     this.DepartmentManager         = departmentManager;
     this.CourseRegistrationManager = courseRegistrationManager;
     this.QuizManager       = quizManager;
     this.AssignmentManager = assignmentManager;
     this.SubmissionManager = submissionManager;
     this.StudentManager    = studentManager;
 }
Ejemplo n.º 10
0
 public EnergyTankModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response)
     : base(appCache, session, response)
 {
 }
 public ProjectorServices(ICacheAdapter cache, IMessageBusAdapter bus, ILockProvider lockProvider, IServiceProvider serviceProvider)
 {
     Cache           = cache ?? throw new ArgumentNullException(nameof(cache));
     Bus             = bus ?? throw new ArgumentNullException(nameof(bus));
     LockProvider    = lockProvider ?? throw new ArgumentNullException(nameof(lockProvider));
     ServiceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
 }
Ejemplo n.º 12
0
 public EnergyTankModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response) :
     base(appCache, session, response)
 {
 }
Ejemplo n.º 13
0
    SQLiteDataSource(string?name, SQLiteConnectionStringBuilder connectionStringBuilder, SQLiteDataSourceSettings settings, SQLiteMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary <Type, object> extensionCache) : base(settings)
    {
        if (connectionStringBuilder == null)
        {
            throw new ArgumentNullException(nameof(connectionStringBuilder), $"{nameof(connectionStringBuilder)} is null.");
        }

        m_ConnectionBuilder = connectionStringBuilder;
        if (string.IsNullOrEmpty(name))
        {
            Name = m_ConnectionBuilder.DataSource;
        }
        else
        {
            Name = name;
        }

        m_DatabaseMetadata = databaseMetadata;
        m_ExtensionCache   = extensionCache;
        m_Cache            = cache;

        if (settings != null)
        {
            EnforceForeignKeys = settings.EnforceForeignKeys;
        }
    }
Ejemplo n.º 14
0
 /// <summary>
 /// 读取缓存
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="key">键</param>
 /// <returns>值</returns>
 public static T Get <T>(string key)
 {
     using (ICacheAdapter cacheAdapter = (ICacheAdapter)Activator.CreateInstance(_CacheImplType))
     {
         return(cacheAdapter.Get <T>(key));
     }
 }
Ejemplo n.º 15
0
 public TagRepository(ILogger <TagRepository> logger, LouisvilleDemographicsContext louisvilleDemographicsContext, ICacheAdapter cacheAdapter, CacheSettings cacheSettings)
 {
     _logger = logger;
     _louisvilleDemographicsContext = louisvilleDemographicsContext;
     _cacheAdapter  = cacheAdapter;
     _cacheSettings = cacheSettings;
 }
Ejemplo n.º 16
0
 public CharacterModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response) :
     base(appCache, session, response)
 {
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecurityAppService"/> class.
 /// </summary>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public SecurityAppService(
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericDbDataSource" /> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="name">The name.</param>
 /// <param name="connectionStringBuilder">The connection string builder.</param>
 /// <param name="settings">Optional settings object.</param>
 /// <exception cref="ArgumentNullException">factory;factory is null.
 /// or
 /// connectionStringBuilder;connectionStringBuilder is null.</exception>
 public GenericDbDataSource(DbProviderFactory factory, string name, DbConnectionStringBuilder connectionStringBuilder, DataSourceSettings settings = null) : base(settings)
 {
     m_Factory           = factory ?? throw new ArgumentNullException(nameof(factory));
     m_ConnectionBuilder = connectionStringBuilder ?? throw new ArgumentNullException(nameof(connectionStringBuilder));;
     Name             = name;
     m_ExtensionCache = new ConcurrentDictionary <Type, object>();
     m_Cache          = DefaultCache;
 }
Ejemplo n.º 19
0
 public RequestCache(
     ICacheAdapter sessionCache,
     AsyncRPGDataContext dbContext)
 {
     m_sessionCache = sessionCache;
     m_dbContext = dbContext;
     m_requestRoomCache = null;
 }
Ejemplo n.º 20
0
 public RequestCache(
     ICacheAdapter sessionCache,
     AsyncRPGDataContext dbContext)
 {
     m_sessionCache     = sessionCache;
     m_dbContext        = dbContext;
     m_requestRoomCache = null;
 }
Ejemplo n.º 21
0
        public TaskFilter(
            string?filterExpression, ICacheAdapter?cache = null)
        {
            _cache = cache ?? new DumbCache();
            var matcher = ExpressionMatcher(filterExpression, true);

            _isValid = matcher is not null;
            _isMatch = matcher ?? AlwaysFalse;
        }
Ejemplo n.º 22
0
 public RestModule(
     ICacheAdapter appCache,
     ISessionAdapter session,
     IResponseAdapter response)
 {
     this.Application = appCache;
     this.Session     = session;
     this.Response    = response;
 }
Ejemplo n.º 23
0
 public RestModule(
     ICacheAdapter appCache,
     ISessionAdapter session, 
     IResponseAdapter response)
 {
     this.Application = appCache;
     this.Session = session;
     this.Response = response;
 }
Ejemplo n.º 24
0
 public CachedCommandDispatcher(ICacheKeyProvider cacheKeyProvider,
                                IFrameworkCommandDispatcher commandDispatcher,
                                ICacheOptionsProvider cacheOptionsProvider,
                                ICacheAdapter cacheAdapter)
 {
     _cacheKeyProvider     = cacheKeyProvider;
     _commandDispatcher    = commandDispatcher;
     _cacheOptionsProvider = cacheOptionsProvider;
     _cacheAdapter         = cacheAdapter;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StaffAppService"/> class.
 /// </summary>
 /// <param name="staffManager">The staff manager.</param>
 /// <param name="objectMapper">The object mapper.</param>
 public StaffAppService(
     IStaffDomainService staffManager,
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
     this.StaffManager = staffManager;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScheduleModuleAppService"/> class.
 /// </summary>
 /// <param name="ScheduleManager">The Schedule manager.</param>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public ScheduleAppService(
     IScheduleDomainService ScheduleManager,
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
     this.ScheduleManager = ScheduleManager;
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserAppService"/> class.
 /// </summary>
 /// <param name="userManager">The user manager.</param>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public UserAppService(
     IUserDomainService userManager,
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
     this.UserManager = userManager;
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 写入缓存(有过期时间)
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="value">值</param>
 /// <param name="expiredTime">过期时间</param>
 public static void Set <T>(string key, T value, DateTime expiredTime)
 {
     using (ICacheAdapter cacheAdapter = (ICacheAdapter)Activator.CreateInstance(_CacheImplType))
     {
         lock (_Sync)
         {
             cacheAdapter.Set(key, value, expiredTime);
         }
     }
 }
Ejemplo n.º 29
0
 public StateMachineManager(
     ICacheAdapter cacheAdapter,
     ITablesRepository tablesRepository,
     ITablesUsagePolicy tablesUsagePolicy)
 {
     _cache                  = cacheAdapter ?? throw new ArgumentNullException(nameof(cacheAdapter));
     _tables                 = tablesRepository ?? throw new ArgumentNullException(nameof(tablesRepository));
     _tablesUsagePolicy      = tablesUsagePolicy ?? throw new ArgumentNullException(nameof(tablesUsagePolicy));
     _defaultCacheExpiration = TimeSpan.FromMinutes(DefaultCacheExpirationInMinutes);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CourseModuleAppService"/> class.
 /// </summary>
 /// <param name="courseManager">The course manager.</param>
 /// <param name="objectMapper">The object mapper.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="exceptionManager">The exception manager.</param>
 /// <param name="loggingService">The logging service.</param>
 public BaseQuestionTopicAppService(
     IBaseQuestionTopicDomainService baseQuestionTopicManager,
     IObjectMapperAdapter objectMapper,
     ICacheAdapter cacheService,
     IExceptionManagerAdapter exceptionManager,
     ILoggingServiceAdapter loggingService)
     : base(objectMapper, cacheService, exceptionManager, loggingService)
 {
     this.BaseQuestionTopicManager = baseQuestionTopicManager;
 }
Ejemplo n.º 31
0
 /// <summary>
 /// 是否存在缓存
 /// </summary>
 /// <param name="key">键</param>
 /// <returns>是否存在</returns>
 public static bool Exists(string key)
 {
     using (ICacheAdapter cacheAdapter = (ICacheAdapter)Activator.CreateInstance(_CacheImplType))
     {
         lock (_Sync)
         {
             return(cacheAdapter.Exists(key));
         }
     }
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Load all dependencies in the Hosted Service.
 /// </summary>
 /// <param name="triasCommunicator">Trias Communicator service</param>
 /// <param name="cacheAdapter">Adapter for the Cache</param>
 /// <param name="logger">Service to log events</param>
 public TripLogger(
     ITriasCommunicator triasCommunicator,
     ICacheAdapter cacheAdapter,
     ILogger <TripLogger> logger
     )
 {
     _triasCommunicator = triasCommunicator;
     _triasCommunicator.RequestFinished += OnTriasCommunicatorRequestFinished;
     _cacheAdapter = cacheAdapter;
     _logger       = logger;
 }
Ejemplo n.º 33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitModuleAppService"/> class.
        /// </summary>
        /// <param name="unitManager">The unit manager.</param>
        /// <param name="objectMapper">The object mapper.</param>
        /// <param name="cacheService">The cache service.</param>
        /// <param name="exceptionManager">The exception manager.</param>
        /// <param name="loggingService">The logging service.</param>
        public VideoAppService(

            IObjectMapperAdapter objectMapper,
            ICacheAdapter cacheService,
            IExceptionManagerAdapter exceptionManager,
            ILoggingServiceAdapter loggingService,
            IVideoDomainService iVideoDomainService)
            : base(objectMapper, cacheService, exceptionManager, loggingService)
        {
            _iVideoDomainService = iVideoDomainService;
        }
Ejemplo n.º 34
0
        public MyQueryService(ILoggerFactory loggerFactory, ICacheAdapter cache, IEntityStore entityStore)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _cache       = cache ?? throw new ArgumentNullException(nameof(cache));
            _entityStore = entityStore ?? throw new ArgumentNullException(nameof(entityStore));
            _logger      = loggerFactory.CreateLogger(GetType());
        }
Ejemplo n.º 35
0
        private SQLiteDataSource(string name, SQLiteConnectionStringBuilder connectionStringBuilder, SQLiteDataSourceSettings settings, SQLiteMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary<Type, object> extensionCache) : base(settings)
        {
            if (connectionStringBuilder == null)
                throw new ArgumentNullException("connectionStringBuilder", "connectionStringBuilder is null.");

            m_ConnectionBuilder = connectionStringBuilder;
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.DataSource;
            else
                Name = name;

            m_DatabaseMetadata = databaseMetadata;
            m_ExtensionCache = extensionCache;
            m_Cache = cache;
        }
Ejemplo n.º 36
0
        public static WorldBuilder GetWorldBuilder(
            AsyncRPGDataContext db_context,
            ICacheAdapter cache)
        {
            WorldBuilder worldBuilder = (WorldBuilder)cache["world_builder"];

            if (worldBuilder == null)
            {
                worldBuilder = new WorldBuilder();
                worldBuilder.Initialize(db_context);

                cache["world_builder"] = worldBuilder;
            }

            return worldBuilder;
        }
Ejemplo n.º 37
0
        public static World GetWorld(
            AsyncRPGDataContext db_context, 
            ICacheAdapter cache, 
            int game_id)
        {
            string world_identifier = GetWorldCacheIdentifier(game_id);
            World world = (World)cache[world_identifier];

            if (world == null)
            {
                world = WorldBuilderCache.GetWorldBuilder(db_context, cache).LazyLoadWorld(db_context, game_id);

                cache[world_identifier] = world;
            }

            return world;
        }
Ejemplo n.º 38
0
        public static bool BuildWorld(
            AsyncRPGDataContext db_context, 
            ICacheAdapter cache, 
            int game_id, 
            out string result)
        {
            World world = null;

            bool success =
                WorldBuilderCache.GetWorldBuilder(db_context, cache).BuildWorld(db_context, game_id, out world, out result);

            if (success)
            {
                string world_identifier = GetWorldCacheIdentifier(game_id);

                cache[world_identifier] = world;
            }

            return success;
        }
Ejemplo n.º 39
0
        public bool ProcessRequest(
            string connection_string,
            ICacheAdapter sessionCache,
            out string result_code)
        {
            bool success = false;

            result_code = ErrorMessages.GENERAL_ERROR;

            // Remember the connection string we're using
            // so that request processors internal to this one
            // can use it as well
            m_connectionString = connection_string;

            while (!success && m_retryCount > 0)
            {
                System.Data.Common.DbTransaction dbTransaction = null;
                AsyncRPGDataContext dbContext = new AsyncRPGDataContext(connection_string);
                RequestCache requestCache = new RequestCache(sessionCache, dbContext);

                m_retryCount--;

                try
                {
                    // Open the db connection immediately
                    dbContext.Connection.Open();

                    // Create a transaction for the request processor.
                    // If anything fails along the way, roll back everything.
                    dbTransaction = dbContext.Connection.BeginTransaction(IsolationLevel.ReadCommitted);

                    // Tell the context about the transaction so that it doesn't create one of it's own
                    dbContext.Transaction = dbTransaction;

                    // Start off assuming success
                    result_code = SuccessMessages.GENERAL_SUCCESS;

                    // Attempt to process the request
                    if (ProcessRequestInternal(
                            requestCache,
                            out result_code))
                    {
                        // Save any modified objects back into the DB
                        requestCache.WriteDirtyObjectsToDatabase();

                        // Commit the transaction to the DB up success
                        dbTransaction.Commit();
                        dbTransaction = null;

                        success = true;
                    }
                    else
                    {
                        // Something failed (in a controlled manner)
                        dbTransaction.Rollback();
                        dbTransaction = null;
                    }
                }
                catch (System.Transactions.TransactionAbortedException ex)
                {
                    // Our attempt to rollback a failed transaction failed.
                    // Possible data corruption :(
                    result_code = ErrorMessages.DB_ERROR + "(Transaction Aborted:" + ex.Message + ")";
                    success = false;

                    // Don't bother retrying in this case
                    m_retryCount = 0;
                }
                catch (System.Exception ex)
                {
                    // An unexpected error occurred
                    // Attempt to rollback any db changes if any were made
                    if (dbTransaction != null)
                    {
                        dbTransaction.Rollback();
                        dbTransaction = null;
                    }

                    // Don't bother retrying in this case
                    result_code = ex.Message;
                    success = false;

                    // Don't bother retrying in this case
                    m_retryCount = 0;
                }
                finally
                {
                    // In all cases, make sure to close the connection to the DB
                    if (dbContext.Connection.State == ConnectionState.Open)
                    {
                        dbContext.Connection.Close();
                    }

                    dbContext = null;
                }
            }

            return success;
        }
Ejemplo n.º 40
0
        private PostgreSqlDataSource(string name, NpgsqlConnectionStringBuilder connectionBuilder, PostgreSqlDataSourceSettings settings, PostgreSqlMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary<Type, object> extensionCache)
            : base(settings)
        {
            if (connectionBuilder == null)
                throw new ArgumentNullException(nameof(connectionBuilder), $"{nameof(connectionBuilder)} is null.");

            m_ConnectionBuilder = connectionBuilder;
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.Database;
            else
                Name = name;

            m_DatabaseMetadata = databaseMetadata;
            m_ExtensionCache = extensionCache;
            m_Cache = cache;
        }
 public USXmlStateProvinceService(ICacheAdapter cacheAdapter)
 {
     _cacheAdapter = cacheAdapter;
 }
Ejemplo n.º 42
0
 /// <summary>
 /// Craetes a new data source with the provided cache.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <returns></returns>
 public SQLiteDataSource WithCache(ICacheAdapter cache)
 {
     var result = WithSettings(null);
     result.m_Cache = cache;
     return result;
 }
Ejemplo n.º 43
0
 public static void ClearWorldBuilder(ICacheAdapter cache)
 {
     cache.Remove("world_builder");
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Craetes a new data source with the provided cache.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <returns></returns>
 public OleDbSqlServerDataSource WithCache(ICacheAdapter cache)
 {
     var result = WithSettings(null);
     result.m_Cache = cache;
     return result;
 }
Ejemplo n.º 45
0
        private OleDbSqlServerDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings, OleDbSqlServerMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary<Type, object> extensionCache) : base(settings)
        {
            if (connectionStringBuilder == null)
                throw new ArgumentNullException("connectionStringBuilder", "connectionStringBuilder is null.");

            m_ConnectionBuilder = connectionStringBuilder;
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.DataSource;
            else
                Name = name;

            m_DatabaseMetadata = databaseMetadata;

            if (settings != null)
            {
                XactAbort = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }
            m_ExtensionCache = extensionCache;
            m_Cache = cache;
        }
Ejemplo n.º 46
0
        public static void ClearWorld(ICacheAdapter cache, int game_id)
        {
            string world_identifier = GetWorldCacheIdentifier(game_id);

            cache.Remove(world_identifier);
        }