From 7dd239bea8b5166b8da4335232e877831f180330 Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Mon, 26 Sep 2022 23:23:09 +0800 Subject: [PATCH] add compile fixes from upstream changes --- .../Metadata/Internal/JetAnnotationProvider.cs | 4 ++-- .../Storage/Internal/JetTransaction.cs | 17 +++-------------- .../Storage/Internal/JetTransactionFactory.cs | 17 ++++++++++++++++- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/EFCore.Jet/Metadata/Internal/JetAnnotationProvider.cs b/src/EFCore.Jet/Metadata/Internal/JetAnnotationProvider.cs index f4accc3..9070494 100644 --- a/src/EFCore.Jet/Metadata/Internal/JetAnnotationProvider.cs +++ b/src/EFCore.Jet/Metadata/Internal/JetAnnotationProvider.cs @@ -39,7 +39,7 @@ namespace EntityFrameworkCore.Jet.Metadata.Internal /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// - public override IEnumerable For(ITableIndex index) + public override IEnumerable For(ITableIndex index, bool designTime) { // Model validation ensures that these facets are the same on all mapped indexes var modelIndex = index.MappedIndexes.First(); @@ -67,7 +67,7 @@ namespace EntityFrameworkCore.Jet.Metadata.Internal /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// - public override IEnumerable For(IColumn column) + public override IEnumerable For(IColumn column, bool designTime) { var table = StoreObjectIdentifier.Table(column.Table.Name, column.Table.Schema); var property = column.PropertyMappings.Where( diff --git a/src/EFCore.Jet/Storage/Internal/JetTransaction.cs b/src/EFCore.Jet/Storage/Internal/JetTransaction.cs index 2bc1f4a..c7e0d75 100644 --- a/src/EFCore.Jet/Storage/Internal/JetTransaction.cs +++ b/src/EFCore.Jet/Storage/Internal/JetTransaction.cs @@ -17,8 +17,9 @@ namespace EntityFrameworkCore.Jet.Storage.Internal [NotNull] DbTransaction transaction, Guid transactionId, [NotNull] IDiagnosticsLogger logger, - bool transactionOwned) - : base(connection, transaction, transactionId, logger, transactionOwned) + bool transactionOwned, + ISqlGenerationHelper sqlGenerationHelper) + : base(connection, transaction, transactionId, logger, transactionOwned, sqlGenerationHelper) { } @@ -34,10 +35,6 @@ namespace EntityFrameworkCore.Jet.Storage.Internal public override Task CreateSavepointAsync(string name, CancellationToken cancellationToken = new CancellationToken()) => throw new NotSupportedException(); - /// - protected override string GetCreateSavepointSql(string name) - => throw new NotSupportedException(); - /// public override void RollbackToSavepoint(string name) => throw new NotSupportedException(); @@ -46,10 +43,6 @@ namespace EntityFrameworkCore.Jet.Storage.Internal public override Task RollbackToSavepointAsync(string name, CancellationToken cancellationToken = new CancellationToken()) => throw new NotSupportedException(); - /// - protected override string GetRollbackToSavepointSql(string name) - => throw new NotSupportedException(); - /// public override void ReleaseSavepoint(string name) => throw new NotSupportedException(); @@ -57,9 +50,5 @@ namespace EntityFrameworkCore.Jet.Storage.Internal /// public override Task ReleaseSavepointAsync(string name, CancellationToken cancellationToken = default) => throw new NotSupportedException(); - - /// - protected override string GetReleaseSavepointSql(string name) - => throw new NotSupportedException(); } } \ No newline at end of file diff --git a/src/EFCore.Jet/Storage/Internal/JetTransactionFactory.cs b/src/EFCore.Jet/Storage/Internal/JetTransactionFactory.cs index dfb1401..e751e5e 100644 --- a/src/EFCore.Jet/Storage/Internal/JetTransactionFactory.cs +++ b/src/EFCore.Jet/Storage/Internal/JetTransactionFactory.cs @@ -8,12 +8,27 @@ namespace EntityFrameworkCore.Jet.Storage.Internal { public class JetTransactionFactory : IRelationalTransactionFactory { + + /// + /// Initializes a new instance of the class. + /// + /// Parameter object containing dependencies for this service. + public JetTransactionFactory(RelationalTransactionFactoryDependencies dependencies) + { + Dependencies = dependencies; + } + + /// + /// Relational provider-specific dependencies for this service. + /// + protected virtual RelationalTransactionFactoryDependencies Dependencies { get; } + public virtual RelationalTransaction Create( IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger logger, bool transactionOwned) - => new JetTransaction(connection, transaction, transactionId, logger, transactionOwned); + => new JetTransaction(connection, transaction, transactionId, logger, transactionOwned,Dependencies.SqlGenerationHelper); } } \ No newline at end of file