Example #1
0
        protected AbstractProviderRepository(ProviderMetadata providerMetadata, IFrameworkContext frameworkContext)
        {
            CanRead               = true;
            ProviderMetadata      = providerMetadata;
            FrameworkContext      = frameworkContext;
            RepositoryScopedCache = new DictionaryScopedCache();

            //HiveContext = new RepositoryContext(RuntimeCacheProvider.Default, PerHttpRequestCacheProvider.Default, frameworkContext);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Object"/> class.
        /// </summary>
        public FakeFrameworkContext(ISerializer serializer = null)
        {
            serializer = serializer ?? new ServiceStackSerialiser();
            var fakeMapperList = new List <Lazy <AbstractMappingEngine, TypeMapperMetadata> >();

            TypeMappers      = new MappingEngineCollection(fakeMapperList);
            CurrentLanguage  = Thread.CurrentThread.CurrentCulture;
            TextManager      = LocalizationConfig.SetupDefault();
            ScopedFinalizer  = new NestedLifetimeFinalizer();
            TaskManager      = new ApplicationTaskManager(Enumerable.Empty <Lazy <AbstractTask, TaskMetadata> >());
            ApplicationCache = new HttpRuntimeApplicationCache();
            ScopedCache      = new DictionaryScopedCache();
            Caches           = new DefaultFrameworkCaches(new DictionaryCacheProvider(), new RuntimeCacheProvider());
            Serialization    = new SerializationService(serializer);
        }