private static void CleanCacheStore()
 {
     using (var store = new ElasticSearchCacheStore<SimpleItem>(new SimpleItemElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Clear();
     }
     using (var store = new ElasticSearchCacheStore<ComplexObject>(new ComplexObjectElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Clear();
     }
 }
Example #2
0
 private static void CleanCacheStore()
 {
     using (var store = new ElasticSearchCacheStore <SimpleItem>(new SimpleItemElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Clear();
     }
     using (var store = new ElasticSearchCacheStore <ComplexObject>(new ComplexObjectElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Clear();
     }
 }
        public SimpleItemFirstLevelCacheManager(string defaultIndex = null) : base()
        {
            if (string.IsNullOrWhiteSpace(defaultIndex))
            {
                defaultIndex = DALSettingsWrapper.DefaultIndexName;
            }
            var uri = DALSettingsWrapper.ElasticSearchEndpoint;

            CacheStore           = new ElasticSearchCacheStore <SimpleItem>(new SimpleItemElasticContext(uri, defaultIndex), uri, defaultIndex);
            PersistentRepository = new SimpleItemRepository(new GoldfinchDbContext());
        }
 private static void FillCacheStore()
 {
     using (var store = new ElasticSearchCacheStore<SimpleItem>(new SimpleItemElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Initialize();
         for (int i = 0; i < 1000; i++)
         {
             var entity = new SimpleItem()
             {
                 PkId = i + 1,
                 ContainerName = "TestContainer",
                 FieldName = "TestField",
                 FieldValue = "Test"
             };
             store.Add(entity);
         }
     }
 }
Example #5
0
 private static void FillCacheStore()
 {
     using (var store = new ElasticSearchCacheStore <SimpleItem>(new SimpleItemElasticContext(), DALSettingsWrapper.ElasticSearchEndpoint, DALSettingsWrapper.DefaultIndexName))
     {
         store.Initialize();
         for (int i = 0; i < 1000; i++)
         {
             var entity = new SimpleItem()
             {
                 PkId          = i + 1,
                 ContainerName = "TestContainer",
                 FieldName     = "TestField",
                 FieldValue    = "Test"
             };
             store.Add(entity);
         }
     }
 }