diff --git a/Build/Build.cs b/Build/Build.cs index f95fede8..93f9167c 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -135,7 +135,7 @@ protected override void OnBuildInitialized() { Log.Information("Generating NuGet packages for projects in solution"); int commitNum = 0; - string NuGetVersionCustom = "2.0.0.881"; + string NuGetVersionCustom = "2.0.0.882"; //if it's not a tagged release - append the commit number to the package version diff --git a/Src/RCommon.Dapper/DapperPersistenceBuilder.cs b/Src/RCommon.Dapper/DapperPersistenceBuilder.cs index d3ad8273..049908a6 100644 --- a/Src/RCommon.Dapper/DapperPersistenceBuilder.cs +++ b/Src/RCommon.Dapper/DapperPersistenceBuilder.cs @@ -39,14 +39,10 @@ public IDapperBuilder AddDbConnection(string dataStoreName, Actio Guard.Against(options == null, "You must configure the options for the RDbConnection for it to be useful"); var dbContext = typeof(TDbConnection).AssemblyQualifiedName; - //this._services.AddTransient(Type.GetType(dbContext), Type.GetType(dbContext)); this._services.TryAddTransient(); this._services.TryAddTransient(Type.GetType(dbContext)); this._services.Configure(options => options.Register(dataStoreName)); - - //var dbContext = typeof(TDbConnection).AssemblyQualifiedName; - //this._services.AddTransient(Type.GetType(dbContext), Type.GetType(dbContext)); this._services.Configure(options); return this; diff --git a/Src/RCommon.EfCore/EFCorePerisistenceBuilder.cs b/Src/RCommon.EfCore/EFCorePerisistenceBuilder.cs index 30d147cc..e26fcbc1 100644 --- a/Src/RCommon.EfCore/EFCorePerisistenceBuilder.cs +++ b/Src/RCommon.EfCore/EFCorePerisistenceBuilder.cs @@ -39,7 +39,6 @@ public IEFCorePersistenceBuilder AddDbContext(string dataStoreName, Guard.Against(dataStoreName.IsNullOrEmpty(), "You must set a name for the Data Store"); this._services.TryAddTransient(); - //this._services.TryAddTransient(); this._services.Configure(options => options.Register(dataStoreName)); this._services.AddDbContext(options, ServiceLifetime.Scoped); diff --git a/Src/RCommon.Linq2Db/Linq2DbPersistenceBuilder.cs b/Src/RCommon.Linq2Db/Linq2DbPersistenceBuilder.cs index c36d4d2f..76af7df5 100644 --- a/Src/RCommon.Linq2Db/Linq2DbPersistenceBuilder.cs +++ b/Src/RCommon.Linq2Db/Linq2DbPersistenceBuilder.cs @@ -39,10 +39,8 @@ public ILinq2DbPersistenceBuilder AddDataConnection(string data Guard.Against(options == null, "You must set options to a value in order for them to be useful"); this._services.TryAddTransient(); - this._services.TryAddTransient(); this._services.Configure(options => options.Register(dataStoreName)); - - _services.AddLinqToDBContext(options); + this._services.AddLinqToDBContext(options); return this; } diff --git a/Src/RCommon.Linq2Db/RCommonDataConnection.cs b/Src/RCommon.Linq2Db/RCommonDataConnection.cs index f180b902..ee60f542 100644 --- a/Src/RCommon.Linq2Db/RCommonDataConnection.cs +++ b/Src/RCommon.Linq2Db/RCommonDataConnection.cs @@ -16,9 +16,8 @@ namespace RCommon.Persistence.Linq2Db { public class RCommonDataConnection : DataConnection, IDataStore { - private readonly IEntityEventTracker _eventTracker; - public RCommonDataConnection(IEntityEventTracker eventTracker, DataOptions linq2DbOptions) + public RCommonDataConnection(DataOptions linq2DbOptions) :base(linq2DbOptions) { diff --git a/Src/RCommon.Persistence/Transactions/UnitOfWork.cs b/Src/RCommon.Persistence/Transactions/UnitOfWork.cs index d3497c9b..5110f202 100644 --- a/Src/RCommon.Persistence/Transactions/UnitOfWork.cs +++ b/Src/RCommon.Persistence/Transactions/UnitOfWork.cs @@ -29,8 +29,7 @@ public UnitOfWork(ILogger logger, IGuidGenerator guidGenerator, IOpt _state = UnitOfWorkState.Created; _transactionScope = TransactionScopeHelper.CreateScope(_logger, this); } - public UnitOfWork(ILogger logger, IGuidGenerator guidGenerator, TransactionMode transactionMode, IsolationLevel isolationLevel, - IEventBus eventBus) + public UnitOfWork(ILogger logger, IGuidGenerator guidGenerator, TransactionMode transactionMode, IsolationLevel isolationLevel) { _logger = logger; _guidGenerator = guidGenerator; diff --git a/Tests/RCommon.Persistence.Dapper.Tests/DapperRepositoryIntegrationTests.cs b/Tests/RCommon.Persistence.Dapper.Tests/DapperRepositoryIntegrationTests.cs index c4393895..6c4f4a3e 100644 --- a/Tests/RCommon.Persistence.Dapper.Tests/DapperRepositoryIntegrationTests.cs +++ b/Tests/RCommon.Persistence.Dapper.Tests/DapperRepositoryIntegrationTests.cs @@ -336,8 +336,8 @@ public async Task UnitOfWork_Nested_Rollback_Works() Order savedOrder = null; savedCustomer = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x => x.Id == customer.Id); savedOrder = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x => x.Id == order.Id); - Assert.That(savedCustomer != null); - Assert.That(savedOrder != null); + Assert.That(savedCustomer == null); + Assert.That(savedOrder == null); } [Test] @@ -437,8 +437,8 @@ public async Task UnitOfWork_Can_Rollback_Multipe_Db_Operations() savedCustomer = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x => x.Id == customer.Id); savedSalesPerson = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x => x.Id == salesPerson.Id); - Assert.That(savedCustomer != null); - Assert.That(savedSalesPerson != null); + Assert.That(savedCustomer == null); + Assert.That(savedSalesPerson == null); } diff --git a/Tests/RCommon.Persistence.EFCore.Tests/EFCoreRepositoryIntegrationTests.cs b/Tests/RCommon.Persistence.EFCore.Tests/EFCoreRepositoryIntegrationTests.cs index 8ada7d44..d14372bb 100644 --- a/Tests/RCommon.Persistence.EFCore.Tests/EFCoreRepositoryIntegrationTests.cs +++ b/Tests/RCommon.Persistence.EFCore.Tests/EFCoreRepositoryIntegrationTests.cs @@ -498,8 +498,8 @@ public async Task UnitOfWork_Nested_Rollback_Works() Order savedOrder = null; savedCustomer = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x => x.Id == customer.Id); savedOrder = await repo.Context.Set().AsNoTracking().FirstOrDefaultAsync(x=>x.Id == order.Id); - Assert.That(savedCustomer != null); - Assert.That(savedOrder != null); + Assert.That(savedCustomer == null); + Assert.That(savedOrder == null); } [Test] diff --git a/Tests/RCommon.Persistence.Linq2Db.Tests/TestDataConnection.cs b/Tests/RCommon.Persistence.Linq2Db.Tests/TestDataConnection.cs index 00a24289..458db60d 100644 --- a/Tests/RCommon.Persistence.Linq2Db.Tests/TestDataConnection.cs +++ b/Tests/RCommon.Persistence.Linq2Db.Tests/TestDataConnection.cs @@ -13,8 +13,8 @@ namespace RCommon.Persistence.Linq2Db.Tests { public class TestDataConnection : RCommonDataConnection { - public TestDataConnection(IEntityEventTracker eventTracker, DataOptions linq2DbOptions) - : base(eventTracker, linq2DbOptions) + public TestDataConnection(DataOptions linq2DbOptions) + : base(linq2DbOptions) { }