Exemplo n.º 1
0
        public static IDocumentStore Init(
            ConsistencyOptions consistencyType,
            string connectionStringName,
            int?maxNumberOfRequests = null)
        {
            if (maxNumberOfRequests == null)
            {
                maxNumberOfRequests = DefaultMaximumNumberOfRequests;
            }

            var store = new DocumentStore
            {
                ConnectionStringName            = connectionStringName,
                EnlistInDistributedTransactions = false,
                Conventions =
                {
                    DefaultQueryingConsistency    = consistencyType,
                    MaxNumberOfRequestsPerSession = maxNumberOfRequests.Value,
                    CustomizeJsonSerializer       = CustomizeJsonSerializer,
                    DisableProfiling   = true,
                    ShouldCacheRequest = s => false,
                    ShouldAggressiveCacheTrackChanges = true
                },
            };

            store.Initialize();

            return(store);
        }
Exemplo n.º 2
0
 public static IDocumentStore Init(
     ConsistencyOptions consistencyType,
     int?maxNumberOfRequests = null)
 {
     return(Init(consistencyType, "RavenDB", maxNumberOfRequests));
 }