public void CouldSelectManyDistributedDataObject() { var Persistor = new DatabasePersistor(migrationConfig: new PostgresMigrationsConfiguration(), distributedMigrationConfig: new DistributedPostgresMigrationsConfiguration(), guidType: SequentialGuidType.SequentialAsBinary); var values = Persistor.Select <RootAsset>().Select(ra => ra.Id).ToList(); RootAsset a; foreach (var value in values) { a = Persistor.GetById <RootAsset>(value); } }
public void CouldCreateTableAndCrudDataObject() { var Persistor = new DatabasePersistor(guidType: SequentialGuidType.SequentialAsBinary); for (int i = 0; i < 10; i++) { var dobj = new TestDataObject() { Value = "inserted" }; Persistor.Insert(dobj); var fromDb = Persistor.GetById <TestDataObject>(dobj.Id); Assert.AreEqual("inserted", fromDb.Value); fromDb.Value = "updated"; Persistor.Update(fromDb); fromDb = Persistor.GetById <TestDataObject>(dobj.Id); Assert.AreEqual("updated", fromDb.Value); } }
public void CouldCreateTableAndCrudDataObject() { var Persistor = new DatabasePersistor(guidType: SequentialGuidType.SequentialAsString, migrationConfig: new MySqlMigrationsConfiguration()); for (int i = 0; i < 1; i++) { var dobj = new TestDataObject() { Value = "inserted", DateTime = DateTime.UtcNow }; Persistor.Insert(dobj); var fromDb = Persistor.GetById <TestDataObject>(dobj.Id); Assert.AreEqual("inserted", fromDb.Value); fromDb.Value = "updated"; Persistor.Update(fromDb); fromDb = Persistor.GetById <TestDataObject>(dobj.Id); Assert.AreEqual("updated", fromDb.Value); } }
public void CouldCreateTableAndCrudDistributedDataObject() { var Persistor = new DatabasePersistor(migrationConfig: new PostgresMigrationsConfiguration(), distributedMigrationConfig: new DistributedPostgresMigrationsConfiguration(), guidType: SequentialGuidType.SequentialAsBinary); for (int i = 0; i < 1; i++) { var dobj = new RootAsset() { Value = "inserted" }; Persistor.Insert(dobj); var fromDb = Persistor.GetById <RootAsset>(dobj.Id); Assert.AreEqual("inserted", fromDb.Value); Console.WriteLine(dobj.Id); fromDb.Value = "updated"; Persistor.Update(fromDb); fromDb = Persistor.GetById <RootAsset>(dobj.Id); Assert.AreEqual("updated", fromDb.Value); } }
public void CouldSelectManyDistributedDataObject() { var Persistor = new DatabasePersistor(guidType: SequentialGuidType.SequentialAsBinary); //Persistor.CreateTable<RootAsset>(true); //var list = new List<RootAsset>(); //for (int i = 0; i < 100000; i++) { // var dobj = new RootAsset() { // Value = "inserted" // }; // list.Add(dobj); //} //Persistor.Insert(list); var values = Persistor.Select <RootAsset>().Select(ra => ra.Id).ToList(); RootAsset a; foreach (var value in values) { a = Persistor.GetById <RootAsset>(value); } //Persistor.GetByIds<RootAsset>(values); }
public void CouldCreateTableAndCrudDataObject() { var Persistor = new DatabasePersistor(guidType: SequentialGuidType.SequentialAsString, migrationConfig: new MySqlMigrationsConfiguration()); for (int i = 0; i < 1; i++) { var dobj = new TestDataObject() { Value = "inserted", DateTime = DateTime.UtcNow }; Persistor.Insert(dobj); var fromDb = Persistor.GetById<TestDataObject>(dobj.Id); Assert.AreEqual("inserted", fromDb.Value); fromDb.Value = "updated"; Persistor.Update(fromDb); fromDb = Persistor.GetById<TestDataObject>(dobj.Id); Assert.AreEqual("updated", fromDb.Value); } }