예제 #1
0
 private void InvokeInitializeCompleted(int opId)
 {
     try
     {
         StoreInitialized?.Invoke(this, EventArgs.Empty);
     }
     catch (Exception e)
     {
         _console.TraceData(TraceEventType.Error, opId, e);
     }
     finally
     {
         _console.TraceEvent(TraceEventType.Stop, opId, GetEventName(opId) + " complete");
     }
 }
예제 #2
0
        private void InitStore(Dictionary <string, string> properties, string storeKey)
        {
            string json = JsonConvert.SerializeObject(properties);

            docStore = JsonConvert.DeserializeObject <DocumentStore>(json);

            docStore.Conventions.MaxNumberOfRequestsPerSession = 1000;

            docStore.Conventions.FindTypeTagName = (type) => type.Name;
            //docStore.Conventions.ShouldCacheRequest = url => true;



            //docStore.Conventions.JsonContractResolver = new EntityContractResolver();
            docStore.RegisterListener(new EntityDocumentConverter());

            docStore.Initialize();
            stores[storeKey] = docStore;

            if (StoreInitialized != null)
            {
                StoreInitialized.Invoke();
            }
        }