Beispiel #1
0
        public IDataSet CreateDataSet(ISetCollection context, Type entityType)
        {
            var result = _cacheData.GetOrAdd(
                entityType,
                t => (Func <ISetCollection, IDataSet>)_genericCreateData.MakeGenericMethod(t).Invoke(null, null))(context);

            return(result as IDataSet);
        }
Beispiel #2
0
        public virtual ICacheSet Create(ISetCollection context, Type entityType)
        {
            var result = _cache.GetOrAdd(
                entityType,
                t => (Func <ISetCollection, ICacheSet>)_genericCreate.MakeGenericMethod(t).Invoke(null, null))(context);

            return(result as ICacheSet);
        }
Beispiel #3
0
 /// <inheritdoc />
 public InternalCacheSet([NotNull] ISetCollection context)
 {
     _context        = context;
     _dictionary     = new ConcurrentDictionary <string, T>();
     _list           = new HashSet <T>();
     _constructor    = typeof(T).GetConstructor(new Type[] { });
     _mergeLock      = new object();
     _cacheMap       = RedisCacher.GetCacheMap <T>();
     _cachingService = new CachingPersistеnceService(_context);
 }
Beispiel #4
0
 public InternalDataSet(ISetCollection context)
 {
 }
Beispiel #5
0
 public CachingPersistеnceService(ISetCollection ctx)
 {
     _context = ctx;
     _cacher  = ctx.Database;
     _rand    = new Random();
 }