public DataModificationQueryBuilder(IRelationalStoreConfiguration configuration, Func <DocumentMap, string> keyAllocator)
 {
     this.mappings      = configuration.DocumentMaps;
     this.serializer    = configuration.DocumentSerializer;
     this.configuration = configuration;
     this.keyAllocator  = keyAllocator;
 }
Ejemplo n.º 2
0
        public static void UseJsonNetSerialization(this IRelationalStoreConfiguration configuration, Action <JsonSerializerSettings> callback)
        {
            if (!(configuration.DocumentSerializer is NewtonsoftDocumentSerializer jsonNet))
            {
                configuration.DocumentSerializer = jsonNet = new NewtonsoftDocumentSerializer(configuration);
            }

            callback(jsonNet.SerializerSettings);
        }
Ejemplo n.º 3
0
 public WriteTransaction(
     RelationalTransactionRegistry registry,
     RetriableOperation operationsToRetry,
     IRelationalStoreConfiguration configuration,
     IKeyAllocator keyAllocator,
     string name = null
     ) : base(registry, operationsToRetry, configuration, name)
 {
     this.configuration = configuration;
     this.keyAllocator  = keyAllocator;
     builder            = new DataModificationQueryBuilder(configuration, AllocateId);
 }
Ejemplo n.º 4
0
 public ReadTransaction(RelationalTransactionRegistry registry, RetriableOperation operationsToRetry, IRelationalStoreConfiguration configuration, string name = null)
 {
     State                  = new Dictionary <string, object>();
     this.registry          = registry;
     this.operationsToRetry = operationsToRetry;
     this.configuration     = configuration;
     this.name              = name ?? Thread.CurrentThread.Name;
     if (string.IsNullOrEmpty(name))
     {
         this.name = "<unknown>";
     }
     registry.Add(this);
 }
Ejemplo n.º 5
0
        public NewtonsoftDocumentSerializer(IRelationalStoreConfiguration configuration)
        {
            var contractResolver = new RelationalJsonContractResolver(configuration);

            SerializerSettings = new JsonSerializerSettings
            {
                ContractResolver = contractResolver,
                TypeNameHandling = TypeNameHandling.Auto,
                TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
            };

            SerializerSettings.Converters.Add(new StringEnumConverter());
            EncodingForCompressedText = new UnicodeEncoding(false, false);
            CompressionLevel          = CompressionLevel.Optimal;
        }
Ejemplo n.º 6
0
 public RelationalStore(IRelationalStoreConfiguration configuration)
 {
     Configuration = configuration;
     registry      = new Lazy <RelationalTransactionRegistry>(() => new RelationalTransactionRegistry(new SqlConnectionStringBuilder(configuration.ConnectionString)));
     keyAllocator  = new Lazy <KeyAllocator>(() => new KeyAllocator(this, configuration.KeyBlockSize));
 }
 public RelationalJsonContractResolver(IRelationalStoreConfiguration configuration)
 {
     this.configuration = configuration;
 }
Ejemplo n.º 8
0
 internal static string GetSchemaNameOrDefault(this IRelationalStoreConfiguration configuration, RelatedDocumentsMapping relatedDocumentsMapping)
 => GetSchemaNameOrDefault(configuration, relatedDocumentsMapping.SchemaName);
Ejemplo n.º 9
0
 internal static string GetSchemaNameOrDefault(this IRelationalStoreConfiguration configuration, DocumentMap documentMap)
 => GetSchemaNameOrDefault(configuration, documentMap.SchemaName);
Ejemplo n.º 10
0
 internal static string GetSchemaNameOrDefault(this IRelationalStoreConfiguration configuration, string schemaName)
 {
     return(schemaName
            ?? configuration.DefaultSchema
            ?? NevermoreDefaults.FallbackDefaultSchemaName);
 }
Ejemplo n.º 11
0
 public DocumentReaderContext(IRelationalStoreConfiguration configuration, DocumentMap map)
 {
     this.configuration = configuration;
     this.map           = map;
     Column             = -1;
 }