private void InitStore() { if (store != null) { return; } if (autoMigrations) { new Migrator(connectionString).Upgrade(); } var jsonSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind, TypeNameHandling = TypeNameHandling.Auto, TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple, }; var mappings = new RelationalMappings(); mappings.Install(new[] { new StoredWorkFlowStateMap() }); store = new RelationalStore( connectionString, appName, new SqlCommandFactory(), mappings, jsonSettings, new EmptyRelatedDocumentStore() ); }
void InitializeStore() { Mappings = new RelationalMappings(); Mappings.Install(new List <DocumentMap>() { new CustomerMap(), new ProductMap(), new LineItemMap() }); Store = BuildRelationalStore(TestDatabaseConnectionString, 0.01); }
public OrderRepository(string connectionString) { Mappings = new RelationalMappings(); Mappings.Install(new[] { new OrderMap() }); Store = new RelationalStore(connectionString, "OrderService", new SqlCommandFactory(), Mappings, Settings, new EmptyRelatedDocumentStore()); }
public DataModificationQueryBuilderFixture() { var mappings = new RelationalMappings(); mappings.Install(new DocumentMap[] { new TestDocumentMap(), new TestDocumentWithRelatedDocumentsMap(), new TestDocumentWithMultipleRelatedDocumentsMap(), new OtherMap() }); builder = new DataModificationQueryBuilder( mappings, new JsonSerializerSettings() ); }
void InitializeStore() { Mappings = new RelationalMappings(); Mappings.Install(new List <DocumentMap>() { new CustomerMap(), new CustomerToTestSerializationMap(), new BrandMap(), new BrandToTestSerializationMap(), new ProductMap <Product>(), new SpecialProductMap(), new ProductToTestSerializationMap(), new LineItemMap(), new MachineMap(), new MachineToTestSerializationMap() }); Store = BuildRelationalStore(TestDatabaseConnectionString, 0.01); }
/// <summary> /// Creates a new Relational Store /// </summary> /// <param name="connectionString">Allows the connection string to be set after the store is built (but before it is used)</param> /// <param name="applicationName">Name of the application in the SQL string</param> /// <param name="sqlCommandFactory"></param> /// <param name="mappings"></param> /// <param name="jsonSettings"></param> /// <param name="relatedDocumentStore">If you don't have releated documents use the EmptyRelatedDocumentStore</param> /// <param name="keyBlockSize">Block size for the KeyAllocator</param> public RelationalStore( Func <string> connectionString, string applicationName, ISqlCommandFactory sqlCommandFactory, RelationalMappings mappings, JsonSerializerSettings jsonSettings, IRelatedDocumentStore relatedDocumentStore, int keyBlockSize = 20) { this.registry = new Lazy <RelationalTransactionRegistry>( () => SetConnectionStringOptions(connectionString(), applicationName) ); this.sqlCommandFactory = sqlCommandFactory; this.mappings = mappings; keyAllocator = new KeyAllocator(this, keyBlockSize); this.jsonSettings = jsonSettings; this.relatedDocumentStore = relatedDocumentStore; }
public RelationalStore( string connectionString, string applicationName, ISqlCommandFactory sqlCommandFactory, RelationalMappings mappings, JsonSerializerSettings jsonSettings, IRelatedDocumentStore relatedDocumentStore, int keyBlockSize = 20) : this( () => connectionString, applicationName, sqlCommandFactory, mappings, jsonSettings, relatedDocumentStore, keyBlockSize ) { }
public RelationalTransaction( RelationalTransactionRegistry registry, RetriableOperation retriableOperation, IsolationLevel isolationLevel, ISqlCommandFactory sqlCommandFactory, JsonSerializerSettings jsonSerializerSettings, RelationalMappings mappings, IKeyAllocator keyAllocator, IRelatedDocumentStore relatedDocumentStore, string name = null, ObjectInitialisationOptions objectInitialisationOptions = ObjectInitialisationOptions.None ) { this.registry = registry; this.retriableOperation = retriableOperation; this.sqlCommandFactory = sqlCommandFactory; this.jsonSerializerSettings = jsonSerializerSettings; this.mappings = mappings; this.keyAllocator = keyAllocator; this.relatedDocumentStore = relatedDocumentStore; this.name = name ?? Thread.CurrentThread.Name; this.objectInitialisationOptions = objectInitialisationOptions; if (string.IsNullOrEmpty(name)) { this.name = "<unknown>"; } dataModificationQueryBuilder = new DataModificationQueryBuilder(mappings, jsonSerializerSettings); try { registry.Add(this); connection = new SqlConnection(registry.ConnectionString); connection.OpenWithRetry(); transaction = connection.BeginTransaction(isolationLevel); } catch { Dispose(); throw; } }
public RelationalStore( string connectionString, string applicationName, ISqlCommandFactory sqlCommandFactory, RelationalMappings mappings, JsonSerializerSettings jsonSettings, IRelatedDocumentStore relatedDocumentStore, int keyBlockSize = 20, ObjectInitialisationOptions objectInitialisationOptions = ObjectInitialisationOptions.None) : this( () => connectionString, applicationName, sqlCommandFactory, mappings, jsonSettings, relatedDocumentStore, keyBlockSize, objectInitialisationOptions ) { }
public BrandConverter(RelationalMappings relationalMappings) : base(relationalMappings) { }
protected InheritedClassConverter(RelationalMappings relationalMappings = null) : base(relationalMappings) { }
public ProductConverter(RelationalMappings relationalMappings) : base(relationalMappings) { }
public DataModificationQueryBuilder(RelationalMappings mappings, JsonSerializerSettings jsonSerializerSettings) { this.mappings = mappings; this.jsonSerializerSettings = jsonSerializerSettings; }
public ProjectionMapper(IDataReader reader, JsonSerializerSettings jsonSerializerSettings, RelationalMappings mappings) { this.mappings = mappings; this.reader = reader; this.jsonSerializerSettings = jsonSerializerSettings; }
public RelationalJsonContractResolver(RelationalMappings mappings) { this.mappings = mappings; }
protected InheritedClassConverterBase(RelationalMappings relationalMappings = null) { RelationalMappings = relationalMappings; }