From 68fc3668b7040f62cdc30b757f7c9c18b7f782b6 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Wed, 27 Oct 2021 09:58:27 +0100 Subject: [PATCH] Check and update service lifetime docs (#26445) --- .../Internal/CosmosModelValidator.cs | 4 +- .../Internal/CosmosSingletonOptions.cs | 6 - .../CosmosQueryCompilationContextFactory.cs | 7 - .../Storage/Internal/CosmosClientWrapper.cs | 7 - .../Storage/Internal/CosmosDatabaseWrapper.cs | 7 - .../CosmosExecutionStrategyFactory.cs | 7 - .../Internal/CosmosTypeMappingSource.cs | 5 +- .../Internal/SingletonCosmosClientWrapper.cs | 7 - .../DesignTimeConnectionStringResolver.cs | 7 - .../IDesignTimeConnectionStringResolver.cs | 6 + .../Internal/InMemorySingletonOptions.cs | 7 - .../Internal/InMemoryQueryContextFactory.cs | 7 - ...thodTranslatingExpressionVisitorFactory.cs | 6 - .../Storage/Internal/InMemoryDatabase.cs | 7 - .../Internal/InMemoryDatabaseCreator.cs | 7 - .../Internal/InMemoryTransactionManager.cs | 7 - .../Internal/InMemoryTypeMappingSource.cs | 6 - .../InMemoryValueGeneratorSelector.cs | 7 - .../Internal/ProxiesConventionSetPlugin.cs | 8 - .../Design/IAnnotationCodeGenerator.cs | 12 +- ...nalCSharpRuntimeAnnotationCodeGenerator.cs | 12 +- .../IRelationalCommandDiagnosticsLogger.cs | 13 +- .../IRelationalConnectionDiagnosticsLogger.cs | 13 +- .../RelationalCommandDiagnosticsLogger.cs | 34 ++--- .../RelationalConnectionDiagnosticsLogger.cs | 20 +-- .../RelationalLoggingDefinitions.cs | 12 +- ...ntityFrameworkRelationalServicesBuilder.cs | 1 - ...elationalAnnotationProviderDependencies.cs | 6 - .../Internal/MigrationCommandExecutor.cs | 6 - .../Migrations/Internal/MigrationsAssembly.cs | 7 - .../Internal/MigrationsIdGenerator.cs | 6 - .../Internal/MigrationsModelDiffer.cs | 6 - .../Migrations/Internal/Migrator.cs | 7 - .../Query/IMemberTranslatorProvider.cs | 7 +- .../Internal/QuerySqlGeneratorFactory.cs | 6 - ...tionalParameterBasedSqlProcessorFactory.cs | 7 - ...elationalQueryCompilationContextFactory.cs | 7 - .../Internal/RelationalQueryContextFactory.cs | 7 - ...nalQueryTranslationPostprocessorFactory.cs | 6 - ...onalQueryTranslationPreprocessorFactory.cs | 7 - ...thodTranslatingExpressionVisitorFactory.cs | 7 - ...dQueryCompilingExpressionVisitorFactory.cs | 7 - ...lSqlTranslatingExpressionVisitorFactory.cs | 19 +-- .../Scaffolding/DatabaseModelFactory.cs | 13 +- .../Scaffolding/IDatabaseModelFactory.cs | 13 +- .../IProviderConfigurationCodeGenerator.cs | 12 +- .../Scaffolding/ProviderCodeGenerator.cs | 12 +- .../Internal/NamedConnectionStringResolver.cs | 7 - .../NamedConnectionStringResolverBase.cs | 6 - .../Storage/Internal/RawSqlCommandBuilder.cs | 6 - .../Update/Internal/BatchExecutor.cs | 7 - .../Update/Internal/CommandBatchPreparer.cs | 7 - .../Internal/KeyValueIndexFactorySource.cs | 6 - .../Internal/ModificationCommandComparer.cs | 6 - ...TopologySuiteMethodCallTranslatorPlugin.cs | 7 - ...NetTopologySuiteTypeMappingSourcePlugin.cs | 7 - .../Internal/SqlServerModelValidator.cs | 6 - .../Internal/SqlServerAnnotationProvider.cs | 6 - .../Internal/SqlServerHistoryRepository.cs | 7 - .../SqlServerMigrationsAnnotationProvider.cs | 6 - ...SqlServerQueryCompilationContextFactory.cs | 7 - .../Internal/SqlServerDatabaseModelFactory.cs | 140 +++++++++--------- .../SqlServerRetryingExecutionStrategy.cs | 17 ++- .../Storage/Internal/SqlServerConnection.cs | 7 - .../Internal/SqlServerDatabaseCreator.cs | 7 - .../SqlServerExecutionStrategyFactory.cs | 7 - .../Internal/SqlServerSqlGenerationHelper.cs | 6 - .../Internal/SqlServerTypeMappingSource.cs | 6 - ...qlServerModificationCommandBatchFactory.cs | 7 - .../Internal/SqlServerUpdateSqlGenerator.cs | 6 - .../Internal/SqlServerValueGeneratorCache.cs | 6 - .../SqlServerValueGeneratorSelector.cs | 7 - .../Internal/SqliteModelValidator.cs | 6 - .../Internal/SqliteAnnotationProvider.cs | 6 - .../Internal/SqliteHistoryRepository.cs | 7 - .../Internal/SqliteDatabaseModelFactory.cs | 6 +- .../Storage/Internal/SqliteDatabaseCreator.cs | 7 - .../Internal/SqliteRelationalConnection.cs | 7 - .../Internal/SqliteSqlGenerationHelper.cs | 6 - .../Internal/SqliteTypeMappingSource.cs | 6 - .../SqliteModificationCommandBatchFactory.cs | 7 - .../Internal/SqliteUpdateSqlGenerator.cs | 6 - ...TopologySuiteMethodCallTranslatorPlugin.cs | 7 - ...NetTopologySuiteTypeMappingSourcePlugin.cs | 7 - .../ChangeTracking/Internal/ChangeDetector.cs | 7 - .../Internal/ChangeTrackerFactory.cs | 7 - .../Internal/EntityEntryGraphIterator.cs | 6 - .../Internal/EntityGraphAttacher.cs | 7 - .../Internal/InternalEntityEntryNotifier.cs | 7 - .../Internal/InternalEntityEntrySubscriber.cs | 6 - .../ChangeTracking/Internal/KeyPropagator.cs | 7 - .../Internal/LocalViewListener.cs | 7 - .../Internal/NavigationFixer.cs | 7 - .../ChangeTracking/Internal/StateManager.cs | 7 - .../Internal/ValueGenerationManager.cs | 7 - .../ICSharpRuntimeAnnotationCodeGenerator.cs | 6 + src/EFCore/Diagnostics/IDbContextLogger.cs | 11 +- .../Diagnostics/IInterceptorAggregator.cs | 8 + .../Diagnostics/InterceptorAggregator.cs | 12 +- .../Diagnostics/Internal/DiagnosticsLogger.cs | 7 - .../Diagnostics/Internal/LoggingOptions.cs | 6 - src/EFCore/Diagnostics/LoggingDefinitions.cs | 12 +- .../EntityFrameworkServicesBuilder.cs | 1 + .../Internal/ConcurrencyDetector.cs | 7 - .../Internal/CoreSingletonOptions.cs | 6 - .../Internal/CurrentDbContext.cs | 7 - .../Infrastructure/Internal/DbSetFinder.cs | 6 - .../Infrastructure/Internal/LazyLoader.cs | 7 - src/EFCore/Internal/DbContextServices.cs | 6 - src/EFCore/Internal/DbSetInitializer.cs | 6 - src/EFCore/Internal/DbSetSource.cs | 6 - src/EFCore/Internal/EntityFinderSource.cs | 6 - src/EFCore/Internal/RegisteredServices.cs | 6 - .../Internal/SingletonOptionsInitializer.cs | 5 - .../Infrastructure/IConventionSetPlugin.cs | 4 +- .../Internal/RuntimeConventionSetBuilder.cs | 8 - .../Internal/ConstructorBindingFactory.cs | 6 - .../EntityTypeParameterBindingFactory.cs | 7 - src/EFCore/Metadata/Internal/IRuntimeModel.cs | 8 + .../Metadata/Internal/MemberClassifier.cs | 6 - src/EFCore/Metadata/Internal/Model.cs | 7 - .../Internal/ParameterBindingFactories.cs | 6 - .../PropertyParameterBindingFactory.cs | 6 - src/EFCore/Metadata/RuntimeModel.cs | 7 + ...INavigationExpansionExtensibilityHelper.cs | 12 +- ...thodTranslatingExpressionVisitorFactory.cs | 7 +- .../Query/Internal/CompiledQueryCache.cs | 6 - .../Internal/EntityMaterializerSource.cs | 6 - .../Query/Internal/EntityQueryProvider.cs | 7 - .../Query/Internal/NullAsyncQueryProvider.cs | 7 - .../QueryCompilationContextFactory.cs | 7 - src/EFCore/Query/Internal/QueryCompiler.cs | 7 - .../QueryTranslationPostprocessorFactory.cs | 6 - .../QueryTranslationPreprocessorFactory.cs | 6 - src/EFCore/Storage/ExecutionStrategy.cs | 13 +- src/EFCore/Storage/IDatabaseCreator.cs | 13 +- .../Internal/DatabaseFacadeDependencies.cs | 7 - .../Internal/ExecutionStrategyFactory.cs | 7 - .../Storage/NonRetryingExecutionStrategy.cs | 13 +- src/EFCore/Update/IUpdateAdapterFactory.cs | 13 +- 140 files changed, 345 insertions(+), 858 deletions(-) rename src/EFCore.Relational/Query/{Internal => }/RelationalSqlTranslatingExpressionVisitorFactory.cs (59%) diff --git a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs index 621225fbb76..dfc46b8d52d 100644 --- a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs +++ b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs @@ -209,7 +209,7 @@ protected virtual void ValidateSharedContainerCompatibility( throughput = currentThroughput; } else if ((throughput.AutoscaleMaxThroughput ?? throughput.Throughput) - != (currentThroughput.AutoscaleMaxThroughput ?? currentThroughput.Throughput)) + != (currentThroughput.AutoscaleMaxThroughput ?? currentThroughput.Throughput)) { var conflictingEntityType = mappedTypes.First(et => et.GetThroughput() != null); throw new InvalidOperationException( @@ -219,7 +219,7 @@ protected virtual void ValidateSharedContainerCompatibility( container)); } else if ((throughput.AutoscaleMaxThroughput == null) - != (currentThroughput.AutoscaleMaxThroughput == null)) + != (currentThroughput.AutoscaleMaxThroughput == null)) { var conflictingEntityType = mappedTypes.First(et => et.GetThroughput() != null); var autoscaleType = throughput.AutoscaleMaxThroughput == null diff --git a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosSingletonOptions.cs b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosSingletonOptions.cs index cd4868beeb6..312a62d8a4b 100644 --- a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosSingletonOptions.cs +++ b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosSingletonOptions.cs @@ -7,7 +7,6 @@ using Microsoft.Azure.Cosmos; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class CosmosSingletonOptions : ICosmosSingletonOptions { /// diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs index 638b318066c..8a6d91cb53b 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class CosmosQueryCompilationContextFactory : IQueryCompilationContextFactory { /// diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs index 5a6fb2ec568..40aaf7d9974 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs @@ -22,7 +22,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -34,12 +33,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class CosmosClientWrapper : ICosmosClientWrapper { /// diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs index 6584745ead1..ad849464200 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs @@ -16,7 +16,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; using Database = Microsoft.EntityFrameworkCore.Storage.Database; @@ -28,12 +27,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class CosmosDatabaseWrapper : Database { private readonly Dictionary _documentCollections = new(); diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosExecutionStrategyFactory.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosExecutionStrategyFactory.cs index f4097c5f309..2f3e8582ea6 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosExecutionStrategyFactory.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosExecutionStrategyFactory.cs @@ -5,7 +5,6 @@ using Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class CosmosExecutionStrategyFactory : IExecutionStrategyFactory { private readonly Func _createExecutionStrategy; diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosTypeMappingSource.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosTypeMappingSource.cs index 24164635269..80dcc99780a 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosTypeMappingSource.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosTypeMappingSource.cs @@ -31,10 +31,7 @@ public CosmosTypeMappingSource(TypeMappingSourceDependencies dependencies) : base(dependencies) { _clrTypeMappings - = new Dictionary - { - { typeof(JObject), new CosmosTypeMapping(typeof(JObject)) } - }; + = new Dictionary { { typeof(JObject), new CosmosTypeMapping(typeof(JObject)) } }; } /// diff --git a/src/EFCore.Cosmos/Storage/Internal/SingletonCosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/SingletonCosmosClientWrapper.cs index 6a533b346b2..ad26aa82df6 100644 --- a/src/EFCore.Cosmos/Storage/Internal/SingletonCosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/SingletonCosmosClientWrapper.cs @@ -4,7 +4,6 @@ using Microsoft.Azure.Cosmos; using Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Storage.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SingletonCosmosClientWrapper : ISingletonCosmosClientWrapper { private static readonly string _userAgent = " Microsoft.EntityFrameworkCore.Cosmos/" + ProductInfo.GetVersion(); diff --git a/src/EFCore.Design/Design/Internal/DesignTimeConnectionStringResolver.cs b/src/EFCore.Design/Design/Internal/DesignTimeConnectionStringResolver.cs index aed5635a4b2..6a5f4eb0671 100644 --- a/src/EFCore.Design/Design/Internal/DesignTimeConnectionStringResolver.cs +++ b/src/EFCore.Design/Design/Internal/DesignTimeConnectionStringResolver.cs @@ -3,7 +3,6 @@ using System; using Microsoft.EntityFrameworkCore.Storage.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Design.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Design.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class DesignTimeConnectionStringResolver : NamedConnectionStringResolverBase, IDesignTimeConnectionStringResolver { private readonly Func? _applicationServiceProviderAccessor; diff --git a/src/EFCore.Design/Design/Internal/IDesignTimeConnectionStringResolver.cs b/src/EFCore.Design/Design/Internal/IDesignTimeConnectionStringResolver.cs index 0e6267abd64..9a784436536 100644 --- a/src/EFCore.Design/Design/Internal/IDesignTimeConnectionStringResolver.cs +++ b/src/EFCore.Design/Design/Internal/IDesignTimeConnectionStringResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Storage.Internal; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Design.Internal { @@ -11,6 +12,11 @@ namespace Microsoft.EntityFrameworkCore.Design.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. /// + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// public interface IDesignTimeConnectionStringResolver : INamedConnectionStringResolver { } diff --git a/src/EFCore.InMemory/Infrastructure/Internal/InMemorySingletonOptions.cs b/src/EFCore.InMemory/Infrastructure/Internal/InMemorySingletonOptions.cs index 3064956ac68..cb5177eb785 100644 --- a/src/EFCore.InMemory/Infrastructure/Internal/InMemorySingletonOptions.cs +++ b/src/EFCore.InMemory/Infrastructure/Internal/InMemorySingletonOptions.cs @@ -5,7 +5,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Infrastructure.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class InMemorySingletonOptions : IInMemorySingletonOptions { /// diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryContextFactory.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryContextFactory.cs index 727c0a13962..1674f45be80 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryContextFactory.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryQueryContextFactory.cs @@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.InMemory.Storage.Internal; using Microsoft.EntityFrameworkCore.Query; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InMemoryQueryContextFactory : IQueryContextFactory { private readonly IInMemoryStore _store; diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs index f4343dc0218..100e0fcbbc8 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { @@ -13,11 +12,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class InMemoryQueryableMethodTranslatingExpressionVisitorFactory : IQueryableMethodTranslatingExpressionVisitorFactory { /// diff --git a/src/EFCore.InMemory/Storage/Internal/InMemoryDatabase.cs b/src/EFCore.InMemory/Storage/Internal/InMemoryDatabase.cs index 328ea5c8c7a..38f80174d0b 100644 --- a/src/EFCore.InMemory/Storage/Internal/InMemoryDatabase.cs +++ b/src/EFCore.InMemory/Storage/Internal/InMemoryDatabase.cs @@ -10,7 +10,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Storage.Internal { @@ -20,12 +19,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InMemoryDatabase : Database, IInMemoryDatabase { private readonly IInMemoryStore _store; diff --git a/src/EFCore.InMemory/Storage/Internal/InMemoryDatabaseCreator.cs b/src/EFCore.InMemory/Storage/Internal/InMemoryDatabaseCreator.cs index 3b7d0cc7822..a661e78a864 100644 --- a/src/EFCore.InMemory/Storage/Internal/InMemoryDatabaseCreator.cs +++ b/src/EFCore.InMemory/Storage/Internal/InMemoryDatabaseCreator.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Storage.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InMemoryDatabaseCreator : IDatabaseCreator { private readonly IDatabase _database; diff --git a/src/EFCore.InMemory/Storage/Internal/InMemoryTransactionManager.cs b/src/EFCore.InMemory/Storage/Internal/InMemoryTransactionManager.cs index 329bf1d05e3..744b5b4be84 100644 --- a/src/EFCore.InMemory/Storage/Internal/InMemoryTransactionManager.cs +++ b/src/EFCore.InMemory/Storage/Internal/InMemoryTransactionManager.cs @@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore.InMemory.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Storage.Internal { @@ -18,12 +17,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InMemoryTransactionManager : IDbContextTransactionManager, ITransactionEnlistmentManager { private static readonly InMemoryTransaction _stubTransaction = new(); diff --git a/src/EFCore.InMemory/Storage/Internal/InMemoryTypeMappingSource.cs b/src/EFCore.InMemory/Storage/Internal/InMemoryTypeMappingSource.cs index a1d2946cb69..5cd0a130259 100644 --- a/src/EFCore.InMemory/Storage/Internal/InMemoryTypeMappingSource.cs +++ b/src/EFCore.InMemory/Storage/Internal/InMemoryTypeMappingSource.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.Storage.Internal { @@ -16,11 +15,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class InMemoryTypeMappingSource : TypeMappingSource { /// diff --git a/src/EFCore.InMemory/ValueGeneration/Internal/InMemoryValueGeneratorSelector.cs b/src/EFCore.InMemory/ValueGeneration/Internal/InMemoryValueGeneratorSelector.cs index 6efdefe8eec..68f511899b1 100644 --- a/src/EFCore.InMemory/ValueGeneration/Internal/InMemoryValueGeneratorSelector.cs +++ b/src/EFCore.InMemory/ValueGeneration/Internal/InMemoryValueGeneratorSelector.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Utilities; using Microsoft.EntityFrameworkCore.ValueGeneration; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.InMemory.ValueGeneration.Internal { @@ -17,12 +16,6 @@ namespace Microsoft.EntityFrameworkCore.InMemory.ValueGeneration.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InMemoryValueGeneratorSelector : ValueGeneratorSelector { private readonly IInMemoryStore _inMemoryStore; diff --git a/src/EFCore.Proxies/Proxies/Internal/ProxiesConventionSetPlugin.cs b/src/EFCore.Proxies/Proxies/Internal/ProxiesConventionSetPlugin.cs index f990a3b6c52..a3935aa985d 100644 --- a/src/EFCore.Proxies/Proxies/Internal/ProxiesConventionSetPlugin.cs +++ b/src/EFCore.Proxies/Proxies/Internal/ProxiesConventionSetPlugin.cs @@ -5,7 +5,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata.Conventions; using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Proxies.Internal { @@ -15,13 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Proxies.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means that each instance will use its own - /// set of instances of this service. - /// The implementations may depend on other services registered with any lifetime. - /// The implementations do not need to be thread-safe. - /// public class ProxiesConventionSetPlugin : IConventionSetPlugin { private readonly IDbContextOptions _options; diff --git a/src/EFCore.Relational/Design/IAnnotationCodeGenerator.cs b/src/EFCore.Relational/Design/IAnnotationCodeGenerator.cs index 5e0ad873df5..758a976166a 100644 --- a/src/EFCore.Relational/Design/IAnnotationCodeGenerator.cs +++ b/src/EFCore.Relational/Design/IAnnotationCodeGenerator.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Design { @@ -15,8 +16,15 @@ namespace Microsoft.EntityFrameworkCore.Design /// the code if needed. /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public interface IAnnotationCodeGenerator { diff --git a/src/EFCore.Relational/Design/Internal/RelationalCSharpRuntimeAnnotationCodeGenerator.cs b/src/EFCore.Relational/Design/Internal/RelationalCSharpRuntimeAnnotationCodeGenerator.cs index 9aa5615796e..d393701771e 100644 --- a/src/EFCore.Relational/Design/Internal/RelationalCSharpRuntimeAnnotationCodeGenerator.cs +++ b/src/EFCore.Relational/Design/Internal/RelationalCSharpRuntimeAnnotationCodeGenerator.cs @@ -53,8 +53,8 @@ public override void Generate(IModel model, CSharpRuntimeAnnotationCodeGenerator annotations.Remove(RelationalAnnotationNames.Collation); if (annotations.TryGetAndRemove( - RelationalAnnotationNames.DbFunctions, - out SortedDictionary functions)) + RelationalAnnotationNames.DbFunctions, + out SortedDictionary functions)) { parameters.Namespaces.Add(typeof(SortedDictionary<,>).Namespace!); parameters.Namespaces.Add(typeof(BindingFlags).Namespace!); @@ -71,8 +71,8 @@ public override void Generate(IModel model, CSharpRuntimeAnnotationCodeGenerator } if (annotations.TryGetAndRemove( - RelationalAnnotationNames.Sequences, - out SortedDictionary<(string, string?), ISequence> sequences)) + RelationalAnnotationNames.Sequences, + out SortedDictionary<(string, string?), ISequence> sequences)) { parameters.Namespaces.Add(typeof(SortedDictionary<,>).Namespace!); var sequencesVariable = Dependencies.CSharpHelper.Identifier("sequences", parameters.ScopeVariables, capitalize: false); @@ -375,8 +375,8 @@ public override void Generate(IProperty property, CSharpRuntimeAnnotationCodeGen annotations.Remove(RelationalAnnotationNames.Collation); if (annotations.TryGetAndRemove( - RelationalAnnotationNames.RelationalOverrides, - out SortedDictionary overrides)) + RelationalAnnotationNames.RelationalOverrides, + out SortedDictionary overrides)) { parameters.Namespaces.Add(typeof(SortedDictionary).Namespace!); var overridesVariable = Dependencies.CSharpHelper.Identifier("overrides", parameters.ScopeVariables, capitalize: false); diff --git a/src/EFCore.Relational/Diagnostics/IRelationalCommandDiagnosticsLogger.cs b/src/EFCore.Relational/Diagnostics/IRelationalCommandDiagnosticsLogger.cs index 21a7310c91d..fc1761096b9 100644 --- a/src/EFCore.Relational/Diagnostics/IRelationalCommandDiagnosticsLogger.cs +++ b/src/EFCore.Relational/Diagnostics/IRelationalCommandDiagnosticsLogger.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -13,8 +14,16 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// An with some extra functionality suited for high-performance logging. /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public interface IRelationalCommandDiagnosticsLogger : IDiagnosticsLogger { diff --git a/src/EFCore.Relational/Diagnostics/IRelationalConnectionDiagnosticsLogger.cs b/src/EFCore.Relational/Diagnostics/IRelationalConnectionDiagnosticsLogger.cs index 4cc5f82a8f4..8a30e99406f 100644 --- a/src/EFCore.Relational/Diagnostics/IRelationalConnectionDiagnosticsLogger.cs +++ b/src/EFCore.Relational/Diagnostics/IRelationalConnectionDiagnosticsLogger.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -12,8 +13,16 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// An with some extra functionality suited for high-performance logging. /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public interface IRelationalConnectionDiagnosticsLogger : IDiagnosticsLogger { diff --git a/src/EFCore.Relational/Diagnostics/Internal/RelationalCommandDiagnosticsLogger.cs b/src/EFCore.Relational/Diagnostics/Internal/RelationalCommandDiagnosticsLogger.cs index 269fafdf18c..384ff9352ea 100644 --- a/src/EFCore.Relational/Diagnostics/Internal/RelationalCommandDiagnosticsLogger.cs +++ b/src/EFCore.Relational/Diagnostics/Internal/RelationalCommandDiagnosticsLogger.cs @@ -84,7 +84,7 @@ public virtual InterceptionResult CommandCreating( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandCreateExpiration = default; @@ -178,7 +178,7 @@ public virtual DbCommand CommandCreated( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandCreateExpiration = default; @@ -285,7 +285,7 @@ public virtual InterceptionResult CommandReaderExecuting( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -345,7 +345,7 @@ public virtual InterceptionResult CommandScalarExecuting( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -405,7 +405,7 @@ public virtual InterceptionResult CommandNonQueryExecuting( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -466,7 +466,7 @@ public virtual ValueTask> CommandReaderExecutin } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -527,7 +527,7 @@ public virtual ValueTask> CommandScalarExecutingAsync } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -588,7 +588,7 @@ public virtual ValueTask> CommandNonQueryExecutingAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -698,7 +698,7 @@ public virtual DbDataReader CommandReaderExecuted( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -761,7 +761,7 @@ public virtual DbDataReader CommandReaderExecuted( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -824,7 +824,7 @@ public virtual int CommandNonQueryExecuted( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -888,7 +888,7 @@ public virtual ValueTask CommandReaderExecutedAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -952,7 +952,7 @@ public virtual ValueTask CommandReaderExecutedAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -1016,7 +1016,7 @@ public virtual ValueTask CommandNonQueryExecutedAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCommandExecuteExpiration = default; @@ -1122,7 +1122,7 @@ public virtual void CommandError( LogCommandError(command, duration, definition); if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { var eventData = BroadcastCommandError( connection.DbConnection, @@ -1186,7 +1186,7 @@ public virtual Task CommandErrorAsync( LogCommandError(command, duration, definition); if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { var eventData = BroadcastCommandError( connection.DbConnection, @@ -1295,7 +1295,7 @@ public virtual InterceptionResult DataReaderDisposing( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressDataReaderDisposingExpiration = default; diff --git a/src/EFCore.Relational/Diagnostics/Internal/RelationalConnectionDiagnosticsLogger.cs b/src/EFCore.Relational/Diagnostics/Internal/RelationalConnectionDiagnosticsLogger.cs index 402267b0830..a6c05ff2f1b 100644 --- a/src/EFCore.Relational/Diagnostics/Internal/RelationalConnectionDiagnosticsLogger.cs +++ b/src/EFCore.Relational/Diagnostics/Internal/RelationalConnectionDiagnosticsLogger.cs @@ -74,7 +74,7 @@ public virtual InterceptionResult ConnectionOpening( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressOpenExpiration = default; @@ -118,7 +118,7 @@ public virtual ValueTask ConnectionOpeningAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressOpenExpiration = default; @@ -195,7 +195,7 @@ public virtual void ConnectionOpened( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressOpenExpiration = default; @@ -234,7 +234,7 @@ public virtual Task ConnectionOpenedAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressOpenExpiration = default; @@ -315,7 +315,7 @@ public virtual InterceptionResult ConnectionClosing( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCloseExpiration = default; @@ -358,7 +358,7 @@ public virtual ValueTask ConnectionClosingAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCloseExpiration = default; @@ -435,7 +435,7 @@ public virtual void ConnectionClosed( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCloseExpiration = default; @@ -473,7 +473,7 @@ public virtual Task ConnectionClosedAsync( } if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { _suppressCloseExpiration = default; @@ -552,7 +552,7 @@ public virtual void ConnectionError( LogConnectionError(connection, definition); if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { var eventData = BroadcastConnectionError( connection, @@ -589,7 +589,7 @@ public virtual Task ConnectionErrorAsync( LogConnectionError(connection, definition); if (NeedsEventData( - definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + definition, out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled)) { var eventData = BroadcastConnectionError( connection, diff --git a/src/EFCore.Relational/Diagnostics/RelationalLoggingDefinitions.cs b/src/EFCore.Relational/Diagnostics/RelationalLoggingDefinitions.cs index cb634651c5d..7390ef26632 100644 --- a/src/EFCore.Relational/Diagnostics/RelationalLoggingDefinitions.cs +++ b/src/EFCore.Relational/Diagnostics/RelationalLoggingDefinitions.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -16,8 +17,15 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public abstract class RelationalLoggingDefinitions : LoggingDefinitions { diff --git a/src/EFCore.Relational/Infrastructure/EntityFrameworkRelationalServicesBuilder.cs b/src/EFCore.Relational/Infrastructure/EntityFrameworkRelationalServicesBuilder.cs index 68644142506..12201c32968 100644 --- a/src/EFCore.Relational/Infrastructure/EntityFrameworkRelationalServicesBuilder.cs +++ b/src/EFCore.Relational/Infrastructure/EntityFrameworkRelationalServicesBuilder.cs @@ -95,7 +95,6 @@ public static readonly IDictionary RelationalServi }, { typeof(IRelationalCommandDiagnosticsLogger), new ServiceCharacteristics(ServiceLifetime.Scoped) }, { typeof(IDiagnosticsLogger), new ServiceCharacteristics(ServiceLifetime.Scoped) }, - { typeof(IInterceptor), new ServiceCharacteristics(ServiceLifetime.Scoped, multipleRegistrations: true) }, { typeof(IRelationalTypeMappingSourcePlugin), new ServiceCharacteristics(ServiceLifetime.Singleton, multipleRegistrations: true) diff --git a/src/EFCore.Relational/Metadata/RelationalAnnotationProviderDependencies.cs b/src/EFCore.Relational/Metadata/RelationalAnnotationProviderDependencies.cs index 3557aa74d18..3c6ebc34c22 100644 --- a/src/EFCore.Relational/Metadata/RelationalAnnotationProviderDependencies.cs +++ b/src/EFCore.Relational/Metadata/RelationalAnnotationProviderDependencies.cs @@ -30,12 +30,6 @@ namespace Microsoft.EntityFrameworkCore.Metadata /// The implementation must be thread-safe. /// This service cannot depend on services registered as . /// - /// - /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to - /// the same compatibility standards as public APIs. It may be changed or removed without notice in - /// 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 sealed record RelationalAnnotationProviderDependencies { diff --git a/src/EFCore.Relational/Migrations/Internal/MigrationCommandExecutor.cs b/src/EFCore.Relational/Migrations/Internal/MigrationCommandExecutor.cs index 3d20118fb0b..e91f0e33341 100644 --- a/src/EFCore.Relational/Migrations/Internal/MigrationCommandExecutor.cs +++ b/src/EFCore.Relational/Migrations/Internal/MigrationCommandExecutor.cs @@ -10,7 +10,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Migrations.Internal { @@ -20,11 +19,6 @@ namespace Microsoft.EntityFrameworkCore.Migrations.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class MigrationCommandExecutor : IMigrationCommandExecutor { /// diff --git a/src/EFCore.Relational/Migrations/Internal/MigrationsAssembly.cs b/src/EFCore.Relational/Migrations/Internal/MigrationsAssembly.cs index 33d29a2f68f..24638ef8b82 100644 --- a/src/EFCore.Relational/Migrations/Internal/MigrationsAssembly.cs +++ b/src/EFCore.Relational/Migrations/Internal/MigrationsAssembly.cs @@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Migrations.Internal { @@ -18,12 +17,6 @@ namespace Microsoft.EntityFrameworkCore.Migrations.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class MigrationsAssembly : IMigrationsAssembly { private readonly IMigrationsIdGenerator _idGenerator; diff --git a/src/EFCore.Relational/Migrations/Internal/MigrationsIdGenerator.cs b/src/EFCore.Relational/Migrations/Internal/MigrationsIdGenerator.cs index f7af0ba7006..a29615a3603 100644 --- a/src/EFCore.Relational/Migrations/Internal/MigrationsIdGenerator.cs +++ b/src/EFCore.Relational/Migrations/Internal/MigrationsIdGenerator.cs @@ -4,7 +4,6 @@ using System; using System.Globalization; using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Migrations.Internal { @@ -14,11 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Migrations.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class MigrationsIdGenerator : IMigrationsIdGenerator { private const string Format = "yyyyMMddHHmmss"; diff --git a/src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs b/src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs index fb81104a7d8..7ad3bebebcc 100644 --- a/src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs +++ b/src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs @@ -29,12 +29,6 @@ namespace Microsoft.EntityFrameworkCore.Migrations.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class MigrationsModelDiffer : IMigrationsModelDiffer { private static readonly Type[] _dropOperationTypes = diff --git a/src/EFCore.Relational/Migrations/Internal/Migrator.cs b/src/EFCore.Relational/Migrations/Internal/Migrator.cs index 367bd5711a5..76a2c63fe00 100644 --- a/src/EFCore.Relational/Migrations/Internal/Migrator.cs +++ b/src/EFCore.Relational/Migrations/Internal/Migrator.cs @@ -12,7 +12,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Migrations.Internal { @@ -22,12 +21,6 @@ namespace Microsoft.EntityFrameworkCore.Migrations.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class Migrator : IMigrator { private readonly IMigrationsAssembly _migrationsAssembly; diff --git a/src/EFCore.Relational/Query/IMemberTranslatorProvider.cs b/src/EFCore.Relational/Query/IMemberTranslatorProvider.cs index e007c4ea400..cc3f3ddb126 100644 --- a/src/EFCore.Relational/Query/IMemberTranslatorProvider.cs +++ b/src/EFCore.Relational/Query/IMemberTranslatorProvider.cs @@ -14,9 +14,10 @@ namespace Microsoft.EntityFrameworkCore.Query /// Provides translations for LINQ expressions. /// /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. /// public interface IMemberTranslatorProvider { diff --git a/src/EFCore.Relational/Query/Internal/QuerySqlGeneratorFactory.cs b/src/EFCore.Relational/Query/Internal/QuerySqlGeneratorFactory.cs index cc2c83aea39..b5b881d2407 100644 --- a/src/EFCore.Relational/Query/Internal/QuerySqlGeneratorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/QuerySqlGeneratorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,11 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class QuerySqlGeneratorFactory : IQuerySqlGeneratorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalParameterBasedSqlProcessorFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalParameterBasedSqlProcessorFactory.cs index ce608ca26d1..882f7ac4053 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalParameterBasedSqlProcessorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalParameterBasedSqlProcessorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalParameterBasedSqlProcessorFactory : IRelationalParameterBasedSqlProcessorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalQueryCompilationContextFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalQueryCompilationContextFactory.cs index 946e156d247..42f9c17a36e 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalQueryCompilationContextFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalQueryCompilationContextFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalQueryCompilationContextFactory : IQueryCompilationContextFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalQueryContextFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalQueryContextFactory.cs index 0b0d735124c..84e3bcfbe21 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalQueryContextFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalQueryContextFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -11,12 +10,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalQueryContextFactory : IQueryContextFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPostprocessorFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPostprocessorFactory.cs index 226612ead10..3bd7d81d853 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPostprocessorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPostprocessorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,11 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class RelationalQueryTranslationPostprocessorFactory : IQueryTranslationPostprocessorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPreprocessorFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPreprocessorFactory.cs index ec56461ef9a..305913b944d 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPreprocessorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalQueryTranslationPreprocessorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalQueryTranslationPreprocessorFactory : IQueryTranslationPreprocessorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalQueryableMethodTranslatingExpressionVisitorFactory.cs index de8cc171461..b3cbaed79f4 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalQueryableMethodTranslatingExpressionVisitorFactory : IQueryableMethodTranslatingExpressionVisitorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalShapedQueryCompilingExpressionVisitorFactory.cs b/src/EFCore.Relational/Query/Internal/RelationalShapedQueryCompilingExpressionVisitorFactory.cs index e138d619c0f..8fa613a4587 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalShapedQueryCompilingExpressionVisitorFactory.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalShapedQueryCompilingExpressionVisitorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class RelationalShapedQueryCompilingExpressionVisitorFactory : IShapedQueryCompilingExpressionVisitorFactory { /// diff --git a/src/EFCore.Relational/Query/Internal/RelationalSqlTranslatingExpressionVisitorFactory.cs b/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitorFactory.cs similarity index 59% rename from src/EFCore.Relational/Query/Internal/RelationalSqlTranslatingExpressionVisitorFactory.cs rename to src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitorFactory.cs index 238de60eb89..617c753abef 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalSqlTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitorFactory.cs @@ -7,10 +7,7 @@ namespace Microsoft.EntityFrameworkCore.Query { /// - /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to - /// the same compatibility standards as public APIs. It may be changed or removed without notice in - /// 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. + /// A factory for creating instances. /// /// /// The service lifetime is . This means that each @@ -21,11 +18,9 @@ namespace Microsoft.EntityFrameworkCore.Query public class RelationalSqlTranslatingExpressionVisitorFactory : IRelationalSqlTranslatingExpressionVisitorFactory { /// - /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to - /// the same compatibility standards as public APIs. It may be changed or removed without notice in - /// 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. + /// Creates an instance of the . /// + /// The service dependencies. public RelationalSqlTranslatingExpressionVisitorFactory( RelationalSqlTranslatingExpressionVisitorDependencies dependencies) { @@ -38,11 +33,11 @@ public RelationalSqlTranslatingExpressionVisitorFactory( protected virtual RelationalSqlTranslatingExpressionVisitorDependencies Dependencies { get; } /// - /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to - /// the same compatibility standards as public APIs. It may be changed or removed without notice in - /// 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. + /// Creates a new . /// + /// The query compilation context to use. + /// The visitor to use to translate subqueries. + /// A relational sql translating expression visitor. public virtual RelationalSqlTranslatingExpressionVisitor Create( QueryCompilationContext queryCompilationContext, QueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor) diff --git a/src/EFCore.Relational/Scaffolding/DatabaseModelFactory.cs b/src/EFCore.Relational/Scaffolding/DatabaseModelFactory.cs index 66b33419222..88b5de320fe 100644 --- a/src/EFCore.Relational/Scaffolding/DatabaseModelFactory.cs +++ b/src/EFCore.Relational/Scaffolding/DatabaseModelFactory.cs @@ -3,6 +3,7 @@ using System.Data.Common; using Microsoft.EntityFrameworkCore.Scaffolding.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Scaffolding { @@ -10,8 +11,16 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// Base class used by database providers to reverse engineer a database into a . /// /// - /// See Reverse engineering (scaffolding) an existing database, and - /// EF Core design-time services for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Reverse engineering (scaffolding) an existing database, and + /// EF Core design-time services for more information. + /// /// public abstract class DatabaseModelFactory : IDatabaseModelFactory { diff --git a/src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs b/src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs index 94379e0113e..cbba09b90ae 100644 --- a/src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs +++ b/src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs @@ -3,6 +3,7 @@ using System.Data.Common; using Microsoft.EntityFrameworkCore.Scaffolding.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Scaffolding { @@ -11,8 +12,16 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// a . /// /// - /// See Reverse engineering (scaffolding) an existing database, and - /// EF Core design-time services for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Reverse engineering (scaffolding) an existing database, and + /// EF Core design-time services for more information. + /// /// public interface IDatabaseModelFactory { diff --git a/src/EFCore.Relational/Scaffolding/IProviderConfigurationCodeGenerator.cs b/src/EFCore.Relational/Scaffolding/IProviderConfigurationCodeGenerator.cs index a42b1498abd..0a48b7a769b 100644 --- a/src/EFCore.Relational/Scaffolding/IProviderConfigurationCodeGenerator.cs +++ b/src/EFCore.Relational/Scaffolding/IProviderConfigurationCodeGenerator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Scaffolding { @@ -10,8 +11,15 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// for reverse engineering. /// /// - /// See Reverse engineering (scaffolding) an existing database, and - /// EF Core design-time services for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Reverse engineering (scaffolding) an existing database, and + /// EF Core design-time services for more information. + /// /// public interface IProviderConfigurationCodeGenerator { diff --git a/src/EFCore.Relational/Scaffolding/ProviderCodeGenerator.cs b/src/EFCore.Relational/Scaffolding/ProviderCodeGenerator.cs index b0e24e07045..3b198153c4c 100644 --- a/src/EFCore.Relational/Scaffolding/ProviderCodeGenerator.cs +++ b/src/EFCore.Relational/Scaffolding/ProviderCodeGenerator.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore.Design; using Microsoft.EntityFrameworkCore.Utilities; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Scaffolding { @@ -10,8 +11,15 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// Generates provider-specific code fragments. /// /// - /// See Reverse engineering (scaffolding) an existing database, and - /// EF Core design-time services for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Reverse engineering (scaffolding) an existing database, and + /// EF Core design-time services for more information. + /// /// public abstract class ProviderCodeGenerator : IProviderConfigurationCodeGenerator { diff --git a/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolver.cs b/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolver.cs index 3e1cd4fa7a7..f07ccac1099 100644 --- a/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolver.cs +++ b/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolver.cs @@ -3,7 +3,6 @@ using System; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class NamedConnectionStringResolver : NamedConnectionStringResolverBase, INamedConnectionStringResolver { private readonly IDbContextOptions _options; diff --git a/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolverBase.cs b/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolverBase.cs index 52c12a3b704..364580c94cd 100644 --- a/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolverBase.cs +++ b/src/EFCore.Relational/Storage/Internal/NamedConnectionStringResolverBase.cs @@ -14,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public abstract class NamedConnectionStringResolverBase { private const string DefaultSection = "ConnectionStrings:"; diff --git a/src/EFCore.Relational/Storage/Internal/RawSqlCommandBuilder.cs b/src/EFCore.Relational/Storage/Internal/RawSqlCommandBuilder.cs index a98f535fdc9..68a39d29bf2 100644 --- a/src/EFCore.Relational/Storage/Internal/RawSqlCommandBuilder.cs +++ b/src/EFCore.Relational/Storage/Internal/RawSqlCommandBuilder.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Data.Common; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage.Internal { @@ -14,11 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class RawSqlCommandBuilder : IRawSqlCommandBuilder { private readonly IRelationalCommandBuilderFactory _relationalCommandBuilderFactory; diff --git a/src/EFCore.Relational/Update/Internal/BatchExecutor.cs b/src/EFCore.Relational/Update/Internal/BatchExecutor.cs index 60be07b7770..54e7e74e00a 100644 --- a/src/EFCore.Relational/Update/Internal/BatchExecutor.cs +++ b/src/EFCore.Relational/Update/Internal/BatchExecutor.cs @@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Update.Internal { @@ -19,12 +18,6 @@ namespace Microsoft.EntityFrameworkCore.Update.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class BatchExecutor : IBatchExecutor { private const string SavepointName = "__EFSavePoint"; diff --git a/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs b/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs index 90c3963ab50..c5f3503bfe3 100644 --- a/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs +++ b/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs @@ -10,7 +10,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Update.Internal { @@ -20,12 +19,6 @@ namespace Microsoft.EntityFrameworkCore.Update.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class CommandBatchPreparer : ICommandBatchPreparer { private readonly int _minBatchSize; diff --git a/src/EFCore.Relational/Update/Internal/KeyValueIndexFactorySource.cs b/src/EFCore.Relational/Update/Internal/KeyValueIndexFactorySource.cs index 955f50edcbb..c034ccb982d 100644 --- a/src/EFCore.Relational/Update/Internal/KeyValueIndexFactorySource.cs +++ b/src/EFCore.Relational/Update/Internal/KeyValueIndexFactorySource.cs @@ -5,7 +5,6 @@ using System.Reflection; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Update.Internal { @@ -15,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Update.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class KeyValueIndexFactorySource : IKeyValueIndexFactorySource { private readonly ConcurrentDictionary _factories = new(); diff --git a/src/EFCore.Relational/Update/Internal/ModificationCommandComparer.cs b/src/EFCore.Relational/Update/Internal/ModificationCommandComparer.cs index 1811ec7f556..5a390283ec9 100644 --- a/src/EFCore.Relational/Update/Internal/ModificationCommandComparer.cs +++ b/src/EFCore.Relational/Update/Internal/ModificationCommandComparer.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Update.Internal { @@ -13,11 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Update.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class ModificationCommandComparer : IComparer { /// diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerNetTopologySuiteMethodCallTranslatorPlugin.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerNetTopologySuiteMethodCallTranslatorPlugin.cs index fc8288bdf08..89d28665df1 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerNetTopologySuiteMethodCallTranslatorPlugin.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerNetTopologySuiteMethodCallTranslatorPlugin.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerNetTopologySuiteMethodCallTranslatorPlugin : IMethodCallTranslatorPlugin { /// diff --git a/src/EFCore.SqlServer.NTS/Storage/Internal/SqlServerNetTopologySuiteTypeMappingSourcePlugin.cs b/src/EFCore.SqlServer.NTS/Storage/Internal/SqlServerNetTopologySuiteTypeMappingSourcePlugin.cs index 3ac2a491cd1..c6e71c51ee3 100644 --- a/src/EFCore.SqlServer.NTS/Storage/Internal/SqlServerNetTopologySuiteTypeMappingSourcePlugin.cs +++ b/src/EFCore.SqlServer.NTS/Storage/Internal/SqlServerNetTopologySuiteTypeMappingSourcePlugin.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; using NetTopologySuite; using NetTopologySuite.Geometries; @@ -17,12 +16,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerNetTopologySuiteTypeMappingSourcePlugin : IRelationalTypeMappingSourcePlugin { private readonly HashSet _spatialStoreTypes = new(StringComparer.OrdinalIgnoreCase) { "geometry", "geography" }; diff --git a/src/EFCore.SqlServer/Infrastructure/Internal/SqlServerModelValidator.cs b/src/EFCore.SqlServer/Infrastructure/Internal/SqlServerModelValidator.cs index a3b7a9718a0..55f794d3f41 100644 --- a/src/EFCore.SqlServer/Infrastructure/Internal/SqlServerModelValidator.cs +++ b/src/EFCore.SqlServer/Infrastructure/Internal/SqlServerModelValidator.cs @@ -12,7 +12,6 @@ using Microsoft.EntityFrameworkCore.SqlServer.Extensions.Internal; using Microsoft.EntityFrameworkCore.SqlServer.Internal; using Microsoft.EntityFrameworkCore.SqlServer.Metadata.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal { @@ -22,11 +21,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerModelValidator : RelationalModelValidator { /// diff --git a/src/EFCore.SqlServer/Metadata/Internal/SqlServerAnnotationProvider.cs b/src/EFCore.SqlServer/Metadata/Internal/SqlServerAnnotationProvider.cs index adba1ce03b9..25b4275d28e 100644 --- a/src/EFCore.SqlServer/Metadata/Internal/SqlServerAnnotationProvider.cs +++ b/src/EFCore.SqlServer/Metadata/Internal/SqlServerAnnotationProvider.cs @@ -7,7 +7,6 @@ using System.Text; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Metadata.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerAnnotationProvider : RelationalAnnotationProvider { /// diff --git a/src/EFCore.SqlServer/Migrations/Internal/SqlServerHistoryRepository.cs b/src/EFCore.SqlServer/Migrations/Internal/SqlServerHistoryRepository.cs index 07a9debca25..2f32634250a 100644 --- a/src/EFCore.SqlServer/Migrations/Internal/SqlServerHistoryRepository.cs +++ b/src/EFCore.SqlServer/Migrations/Internal/SqlServerHistoryRepository.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Migrations.Internal { @@ -17,12 +16,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Migrations.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerHistoryRepository : HistoryRepository { /// diff --git a/src/EFCore.SqlServer/Migrations/Internal/SqlServerMigrationsAnnotationProvider.cs b/src/EFCore.SqlServer/Migrations/Internal/SqlServerMigrationsAnnotationProvider.cs index 4b479cf88ab..c9b932b91e8 100644 --- a/src/EFCore.SqlServer/Migrations/Internal/SqlServerMigrationsAnnotationProvider.cs +++ b/src/EFCore.SqlServer/Migrations/Internal/SqlServerMigrationsAnnotationProvider.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.SqlServer.Metadata.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Migrations.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Migrations.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerMigrationsAnnotationProvider : MigrationsAnnotationProvider { /// diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerQueryCompilationContextFactory.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerQueryCompilationContextFactory.cs index 80d2e65d909..4b381f21516 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerQueryCompilationContextFactory.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerQueryCompilationContextFactory.cs @@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerQueryCompilationContextFactory : IQueryCompilationContextFactory { private readonly ISqlServerConnection _sqlServerConnection; diff --git a/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerDatabaseModelFactory.cs b/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerDatabaseModelFactory.cs index 54d3dff5a35..6d2ee898b8c 100644 --- a/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerDatabaseModelFactory.cs +++ b/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerDatabaseModelFactory.cs @@ -155,9 +155,9 @@ public override DatabaseModel Create(DbConnection connection, DatabaseModelFacto GetTables(connection, databaseModel, tableFilter, typeAliases, databaseCollation); foreach (var schema in schemaList - .Except( - databaseModel.Sequences.Select(s => s.Schema) - .Concat(databaseModel.Tables.Select(t => t.Schema)))) + .Except( + databaseModel.Sequences.Select(s => s.Schema) + .Concat(databaseModel.Tables.Select(t => t.Schema)))) { _logger.MissingSchemaWarning(schema); } @@ -166,9 +166,9 @@ public override DatabaseModel Create(DbConnection connection, DatabaseModelFacto { var (parsedSchema, parsedTableName) = Parse(table); if (!databaseModel.Tables.Any( - t => !string.IsNullOrEmpty(parsedSchema) - && t.Schema == parsedSchema - || t.Name == parsedTableName)) + t => !string.IsNullOrEmpty(parsedSchema) + && t.Schema == parsedSchema + || t.Name == parsedTableName)) { _logger.MissingTableWarning(table); } @@ -250,14 +250,14 @@ FROM sys.databases { return schemas.Count > 0 ? (s => - { - var schemaFilterBuilder = new StringBuilder(); - schemaFilterBuilder.Append(s); - schemaFilterBuilder.Append(" IN ("); - schemaFilterBuilder.AppendJoin(", ", schemas.Select(EscapeLiteral)); - schemaFilterBuilder.Append(')'); - return schemaFilterBuilder.ToString(); - }) + { + var schemaFilterBuilder = new StringBuilder(); + schemaFilterBuilder.Append(s); + schemaFilterBuilder.Append(" IN ("); + schemaFilterBuilder.AppendJoin(", ", schemas.Select(EscapeLiteral)); + schemaFilterBuilder.Append(')'); + return schemaFilterBuilder.ToString(); + }) : null; } @@ -282,70 +282,70 @@ private static (string? Schema, string Table) Parse(string table) => schemaFilter != null || tables.Count > 0 ? ((s, t) => + { + var tableFilterBuilder = new StringBuilder(); + + var openBracket = false; + if (schemaFilter != null) { - var tableFilterBuilder = new StringBuilder(); + tableFilterBuilder + .Append('(') + .Append(schemaFilter(s)); + openBracket = true; + } - var openBracket = false; - if (schemaFilter != null) + if (tables.Count > 0) + { + if (openBracket) { tableFilterBuilder - .Append('(') - .Append(schemaFilter(s)); + .AppendLine() + .Append("OR "); + } + else + { + tableFilterBuilder.Append('('); openBracket = true; } - if (tables.Count > 0) + var tablesWithoutSchema = tables.Where(e => string.IsNullOrEmpty(e.Schema)).ToList(); + if (tablesWithoutSchema.Count > 0) { - if (openBracket) - { - tableFilterBuilder - .AppendLine() - .Append("OR "); - } - else - { - tableFilterBuilder.Append('('); - openBracket = true; - } + tableFilterBuilder.Append(t); + tableFilterBuilder.Append(" IN ("); + tableFilterBuilder.AppendJoin(", ", tablesWithoutSchema.Select(e => EscapeLiteral(e.Table))); + tableFilterBuilder.Append(')'); + } - var tablesWithoutSchema = tables.Where(e => string.IsNullOrEmpty(e.Schema)).ToList(); + var tablesWithSchema = tables.Where(e => !string.IsNullOrEmpty(e.Schema)).ToList(); + if (tablesWithSchema.Count > 0) + { if (tablesWithoutSchema.Count > 0) { - tableFilterBuilder.Append(t); - tableFilterBuilder.Append(" IN ("); - tableFilterBuilder.AppendJoin(", ", tablesWithoutSchema.Select(e => EscapeLiteral(e.Table))); - tableFilterBuilder.Append(')'); + tableFilterBuilder.Append(" OR "); } - var tablesWithSchema = tables.Where(e => !string.IsNullOrEmpty(e.Schema)).ToList(); - if (tablesWithSchema.Count > 0) - { - if (tablesWithoutSchema.Count > 0) - { - tableFilterBuilder.Append(" OR "); - } - - tableFilterBuilder.Append(t); - tableFilterBuilder.Append(" IN ("); - tableFilterBuilder.AppendJoin(", ", tablesWithSchema.Select(e => EscapeLiteral(e.Table))); - tableFilterBuilder.Append(") AND ("); - tableFilterBuilder.Append(s); - tableFilterBuilder.Append(" + N'.' + "); - tableFilterBuilder.Append(t); - tableFilterBuilder.Append(") IN ("); - tableFilterBuilder.AppendJoin( - ", ", tablesWithSchema.Select(e => EscapeLiteral($"{e.Schema}.{e.Table}"))); - tableFilterBuilder.Append(')'); - } - } - - if (openBracket) - { + tableFilterBuilder.Append(t); + tableFilterBuilder.Append(" IN ("); + tableFilterBuilder.AppendJoin(", ", tablesWithSchema.Select(e => EscapeLiteral(e.Table))); + tableFilterBuilder.Append(") AND ("); + tableFilterBuilder.Append(s); + tableFilterBuilder.Append(" + N'.' + "); + tableFilterBuilder.Append(t); + tableFilterBuilder.Append(") IN ("); + tableFilterBuilder.AppendJoin( + ", ", tablesWithSchema.Select(e => EscapeLiteral($"{e.Schema}.{e.Table}"))); tableFilterBuilder.Append(')'); } + } - return tableFilterBuilder.ToString(); - }) + if (openBracket) + { + tableFilterBuilder.Append(')'); + } + + return tableFilterBuilder.ToString(); + }) : null; private static string EscapeLiteral(string s) @@ -869,14 +869,14 @@ UNION ALL } } else if ((defaultValue == "(CONVERT([real],(0)))" && dataTypeName == "real") - || (defaultValue == "((0.0000000000000000e+000))" && dataTypeName == "float") - || (defaultValue == "(0.0000000000000000e+000)" && dataTypeName == "float") - || (defaultValue == "('0001-01-01')" && dataTypeName == "date") - || (defaultValue == "('1900-01-01T00:00:00.000')" && (dataTypeName == "datetime" || dataTypeName == "smalldatetime")) - || (defaultValue == "('0001-01-01T00:00:00.000')" && dataTypeName == "datetime2") - || (defaultValue == "('0001-01-01T00:00:00.000+00:00')" && dataTypeName == "datetimeoffset") - || (defaultValue == "('00:00:00')" && dataTypeName == "time") - || (defaultValue == "('00000000-0000-0000-0000-000000000000')" && dataTypeName == "uniqueidentifier")) + || (defaultValue == "((0.0000000000000000e+000))" && dataTypeName == "float") + || (defaultValue == "(0.0000000000000000e+000)" && dataTypeName == "float") + || (defaultValue == "('0001-01-01')" && dataTypeName == "date") + || (defaultValue == "('1900-01-01T00:00:00.000')" && (dataTypeName == "datetime" || dataTypeName == "smalldatetime")) + || (defaultValue == "('0001-01-01T00:00:00.000')" && dataTypeName == "datetime2") + || (defaultValue == "('0001-01-01T00:00:00.000+00:00')" && dataTypeName == "datetimeoffset") + || (defaultValue == "('00:00:00')" && dataTypeName == "time") + || (defaultValue == "('00000000-0000-0000-0000-000000000000')" && dataTypeName == "uniqueidentifier")) { return null; } diff --git a/src/EFCore.SqlServer/SqlServerRetryingExecutionStrategy.cs b/src/EFCore.SqlServer/SqlServerRetryingExecutionStrategy.cs index 2e8dc32325c..dfdb8bdd01f 100644 --- a/src/EFCore.SqlServer/SqlServerRetryingExecutionStrategy.cs +++ b/src/EFCore.SqlServer/SqlServerRetryingExecutionStrategy.cs @@ -6,6 +6,7 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; // ReSharper disable once CheckNamespace namespace Microsoft.EntityFrameworkCore @@ -14,8 +15,20 @@ namespace Microsoft.EntityFrameworkCore /// An implementation for retrying failed executions on SQL Server. /// /// - /// This strategy is specifically tailored to SQL Server (including SQL Azure). It is pre-configured with - /// error numbers for transient errors that can be retried. Additional error numbers to retry on can also be supplied. + /// + /// This strategy is specifically tailored to SQL Server (including SQL Azure). It is pre-configured with + /// error numbers for transient errors that can be retried. Additional error numbers to retry on can also be supplied. + /// + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Connection resiliency and database retries + /// for more information. + /// /// public class SqlServerRetryingExecutionStrategy : ExecutionStrategy { diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs index ca4c8cd0185..455715b463d 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs @@ -5,7 +5,6 @@ using System.Data.Common; using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerConnection : RelationalConnection, ISqlServerConnection { // Compensate for slow SQL Server database creation diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerDatabaseCreator.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerDatabaseCreator.cs index 2ea7186ee05..b14f5e85db7 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerDatabaseCreator.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerDatabaseCreator.cs @@ -14,7 +14,6 @@ using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.EntityFrameworkCore.SqlServer.Internal; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal { @@ -24,12 +23,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerDatabaseCreator : RelationalDatabaseCreator { private readonly ISqlServerConnection _connection; diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerExecutionStrategyFactory.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerExecutionStrategyFactory.cs index f44f19ca072..c45a2c64d9d 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerExecutionStrategyFactory.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerExecutionStrategyFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerExecutionStrategyFactory : RelationalExecutionStrategyFactory { /// diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs index b357303e023..850d1bab999 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.SqlServer.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal { @@ -16,11 +15,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerSqlGenerationHelper : RelationalSqlGenerationHelper { /// diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs index 04b077b5f22..d1b2cf75289 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs @@ -8,7 +8,6 @@ using System.Linq; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal { @@ -18,11 +17,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerTypeMappingSource : RelationalTypeMappingSource { private readonly RelationalTypeMapping _sqlVariant diff --git a/src/EFCore.SqlServer/Update/Internal/SqlServerModificationCommandBatchFactory.cs b/src/EFCore.SqlServer/Update/Internal/SqlServerModificationCommandBatchFactory.cs index e80180850a3..acde5499e31 100644 --- a/src/EFCore.SqlServer/Update/Internal/SqlServerModificationCommandBatchFactory.cs +++ b/src/EFCore.SqlServer/Update/Internal/SqlServerModificationCommandBatchFactory.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Update.Internal { @@ -16,12 +15,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Update.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerModificationCommandBatchFactory : IModificationCommandBatchFactory { private readonly IDbContextOptions _options; diff --git a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs index dd84544bb9a..ea81c89ce25 100644 --- a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs +++ b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs @@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.Update.Internal { @@ -19,11 +18,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Update.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerUpdateSqlGenerator : UpdateSqlGenerator, ISqlServerUpdateSqlGenerator { /// diff --git a/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorCache.cs b/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorCache.cs index c14e7124332..f5685665a4f 100644 --- a/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorCache.cs +++ b/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorCache.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; using Microsoft.EntityFrameworkCore.ValueGeneration; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.ValueGeneration.Internal { @@ -16,11 +15,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.ValueGeneration.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqlServerValueGeneratorCache : ValueGeneratorCache, ISqlServerValueGeneratorCache { private readonly ConcurrentDictionary _sequenceGeneratorCache = new(); diff --git a/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorSelector.cs b/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorSelector.cs index 27628cea42f..a690abe45ef 100644 --- a/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorSelector.cs +++ b/src/EFCore.SqlServer/ValueGeneration/Internal/SqlServerValueGeneratorSelector.cs @@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; using Microsoft.EntityFrameworkCore.ValueGeneration; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.SqlServer.ValueGeneration.Internal { @@ -18,12 +17,6 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.ValueGeneration.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqlServerValueGeneratorSelector : RelationalValueGeneratorSelector { private readonly ISqlServerSequenceValueGeneratorFactory _sequenceFactory; diff --git a/src/EFCore.Sqlite.Core/Infrastructure/Internal/SqliteModelValidator.cs b/src/EFCore.Sqlite.Core/Infrastructure/Internal/SqliteModelValidator.cs index 483f57cdef1..35fd1b44c50 100644 --- a/src/EFCore.Sqlite.Core/Infrastructure/Internal/SqliteModelValidator.cs +++ b/src/EFCore.Sqlite.Core/Infrastructure/Internal/SqliteModelValidator.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Sqlite.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Infrastructure.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Infrastructure.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteModelValidator : RelationalModelValidator { /// diff --git a/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs b/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs index de7f7837e39..123305110d6 100644 --- a/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs +++ b/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Metadata.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteAnnotationProvider : RelationalAnnotationProvider { /// diff --git a/src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs b/src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs index f18c04f93f9..4e3319c5ffa 100644 --- a/src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs +++ b/src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs @@ -5,7 +5,6 @@ using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Sqlite.Internal; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Migrations.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Migrations.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqliteHistoryRepository : HistoryRepository { /// diff --git a/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteDatabaseModelFactory.cs b/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteDatabaseModelFactory.cs index 98e0f66f45f..1d672792484 100644 --- a/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteDatabaseModelFactory.cs +++ b/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteDatabaseModelFactory.cs @@ -328,8 +328,7 @@ private void GetPrimaryKey(DbConnection connection, DatabaseTable table) var primaryKey = new DatabasePrimaryKey { - Table = table, - Name = name.StartsWith("sqlite_", StringComparison.Ordinal) ? string.Empty : name + Table = table, Name = name.StartsWith("sqlite_", StringComparison.Ordinal) ? string.Empty : name }; _logger.PrimaryKeyFound(name, table.Name); @@ -415,8 +414,7 @@ private void GetUniqueConstraints(DbConnection connection, DatabaseTable table) var constraintName = reader1.GetString(0); var uniqueConstraint = new DatabaseUniqueConstraint { - Table = table, - Name = constraintName.StartsWith("sqlite_", StringComparison.Ordinal) ? string.Empty : constraintName + Table = table, Name = constraintName.StartsWith("sqlite_", StringComparison.Ordinal) ? string.Empty : constraintName }; _logger.UniqueConstraintFound(constraintName, table.Name); diff --git a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteDatabaseCreator.cs b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteDatabaseCreator.cs index 36e826ec872..69088be2983 100644 --- a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteDatabaseCreator.cs +++ b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteDatabaseCreator.cs @@ -6,7 +6,6 @@ using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal { @@ -16,12 +15,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqliteDatabaseCreator : RelationalDatabaseCreator { // ReSharper disable once InconsistentNaming diff --git a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs index 48d00281c0b..a4714969d31 100644 --- a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs +++ b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs @@ -13,7 +13,6 @@ using Microsoft.EntityFrameworkCore.Sqlite.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal { @@ -23,12 +22,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqliteRelationalConnection : RelationalConnection, ISqliteRelationalConnection { private readonly IRawSqlCommandBuilder _rawSqlCommandBuilder; diff --git a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteSqlGenerationHelper.cs b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteSqlGenerationHelper.cs index db41ea92001..52967109ea0 100644 --- a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteSqlGenerationHelper.cs +++ b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteSqlGenerationHelper.cs @@ -3,7 +3,6 @@ using System.Text; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal { @@ -13,11 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteSqlGenerationHelper : RelationalSqlGenerationHelper { /// diff --git a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteTypeMappingSource.cs b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteTypeMappingSource.cs index 955f96a7592..d5ad7d95b37 100644 --- a/src/EFCore.Sqlite.Core/Storage/Internal/SqliteTypeMappingSource.cs +++ b/src/EFCore.Sqlite.Core/Storage/Internal/SqliteTypeMappingSource.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal { @@ -15,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteTypeMappingSource : RelationalTypeMappingSource { private static readonly HashSet _spatialiteTypes diff --git a/src/EFCore.Sqlite.Core/Update/Internal/SqliteModificationCommandBatchFactory.cs b/src/EFCore.Sqlite.Core/Update/Internal/SqliteModificationCommandBatchFactory.cs index e1ebd259b26..9f945a23c3a 100644 --- a/src/EFCore.Sqlite.Core/Update/Internal/SqliteModificationCommandBatchFactory.cs +++ b/src/EFCore.Sqlite.Core/Update/Internal/SqliteModificationCommandBatchFactory.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Update.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Update.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class SqliteModificationCommandBatchFactory : IModificationCommandBatchFactory { /// diff --git a/src/EFCore.Sqlite.Core/Update/Internal/SqliteUpdateSqlGenerator.cs b/src/EFCore.Sqlite.Core/Update/Internal/SqliteUpdateSqlGenerator.cs index 2bac49f918d..cb1889981b9 100644 --- a/src/EFCore.Sqlite.Core/Update/Internal/SqliteUpdateSqlGenerator.cs +++ b/src/EFCore.Sqlite.Core/Update/Internal/SqliteUpdateSqlGenerator.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.Sqlite.Internal; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Update.Internal { @@ -16,11 +15,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Update.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteUpdateSqlGenerator : UpdateSqlGenerator { /// diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs index 38fe4e790be..13c0beb13d2 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Query; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteNetTopologySuiteMethodCallTranslatorPlugin : IMethodCallTranslatorPlugin { /// diff --git a/src/EFCore.Sqlite.NTS/Storage/Internal/SqliteNetTopologySuiteTypeMappingSourcePlugin.cs b/src/EFCore.Sqlite.NTS/Storage/Internal/SqliteNetTopologySuiteTypeMappingSourcePlugin.cs index 7fc2165d66a..dbb7098fb20 100644 --- a/src/EFCore.Sqlite.NTS/Storage/Internal/SqliteNetTopologySuiteTypeMappingSourcePlugin.cs +++ b/src/EFCore.Sqlite.NTS/Storage/Internal/SqliteNetTopologySuiteTypeMappingSourcePlugin.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; using NetTopologySuite; using NetTopologySuite.Geometries; @@ -17,12 +16,6 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Storage.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SqliteNetTopologySuiteTypeMappingSourcePlugin : IRelationalTypeMappingSourcePlugin { private static readonly Dictionary _storeTypeMappings = new(StringComparer.OrdinalIgnoreCase) diff --git a/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs b/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs index c265127d4ff..1db688b729c 100644 --- a/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs +++ b/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs @@ -10,7 +10,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -20,12 +19,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class ChangeDetector : IChangeDetector { private readonly IDiagnosticsLogger _logger; diff --git a/src/EFCore/ChangeTracking/Internal/ChangeTrackerFactory.cs b/src/EFCore/ChangeTracking/Internal/ChangeTrackerFactory.cs index 6d04a7c19ba..6c09b1df79c 100644 --- a/src/EFCore/ChangeTracking/Internal/ChangeTrackerFactory.cs +++ b/src/EFCore/ChangeTracking/Internal/ChangeTrackerFactory.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class ChangeTrackerFactory : IChangeTrackerFactory { private readonly DbContext _context; diff --git a/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs b/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs index 2c3a1e8eea0..d7a9f2214ff 100644 --- a/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs +++ b/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -18,11 +17,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class EntityEntryGraphIterator : IEntityEntryGraphIterator { /// diff --git a/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs b/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs index 86492ae44ab..f80ae274834 100644 --- a/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs +++ b/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class EntityGraphAttacher : IEntityGraphAttacher { private readonly IEntityEntryGraphIterator _graphIterator; diff --git a/src/EFCore/ChangeTracking/Internal/InternalEntityEntryNotifier.cs b/src/EFCore/ChangeTracking/Internal/InternalEntityEntryNotifier.cs index 57e364a15ef..1ad1a7eefb1 100644 --- a/src/EFCore/ChangeTracking/Internal/InternalEntityEntryNotifier.cs +++ b/src/EFCore/ChangeTracking/Internal/InternalEntityEntryNotifier.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class InternalEntityEntryNotifier : IInternalEntityEntryNotifier { private readonly ILocalViewListener _localViewListener; diff --git a/src/EFCore/ChangeTracking/Internal/InternalEntityEntrySubscriber.cs b/src/EFCore/ChangeTracking/Internal/InternalEntityEntrySubscriber.cs index b3a2079dc02..1e7429b63b3 100644 --- a/src/EFCore/ChangeTracking/Internal/InternalEntityEntrySubscriber.cs +++ b/src/EFCore/ChangeTracking/Internal/InternalEntityEntrySubscriber.cs @@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Microsoft.Extensions.DependencyInjection; // ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal @@ -19,11 +18,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class InternalEntityEntrySubscriber : IInternalEntityEntrySubscriber { /// diff --git a/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs b/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs index 76832132908..0ababced404 100644 --- a/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs +++ b/src/EFCore/ChangeTracking/Internal/KeyPropagator.cs @@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Utilities; using Microsoft.EntityFrameworkCore.ValueGeneration; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -18,12 +17,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class KeyPropagator : IKeyPropagator { private readonly IValueGeneratorSelector _valueGeneratorSelector; diff --git a/src/EFCore/ChangeTracking/Internal/LocalViewListener.cs b/src/EFCore/ChangeTracking/Internal/LocalViewListener.cs index cb0f099a7c9..84a4072efcd 100644 --- a/src/EFCore/ChangeTracking/Internal/LocalViewListener.cs +++ b/src/EFCore/ChangeTracking/Internal/LocalViewListener.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class LocalViewListener : ILocalViewListener { private readonly IList> _viewActions diff --git a/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs b/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs index 64fa0a77bf5..54c1cde1c16 100644 --- a/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs +++ b/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs @@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -19,12 +18,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class NavigationFixer : INavigationFixer { private IList? _danglingJoinEntities; diff --git a/src/EFCore/ChangeTracking/Internal/StateManager.cs b/src/EFCore/ChangeTracking/Internal/StateManager.cs index d7e92dd356d..7457dc14b1e 100644 --- a/src/EFCore/ChangeTracking/Internal/StateManager.cs +++ b/src/EFCore/ChangeTracking/Internal/StateManager.cs @@ -15,7 +15,6 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Update; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -26,12 +25,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class StateManager : IStateManager { private readonly EntityReferenceMap _entityReferenceMap = new(hasSubMap: true); diff --git a/src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs b/src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs index 01edc381e9f..342bcc52fe9 100644 --- a/src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs +++ b/src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs @@ -7,7 +7,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.ValueGeneration; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal { @@ -17,12 +16,6 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class ValueGenerationManager : IValueGenerationManager { private readonly IValueGeneratorSelector _valueGeneratorSelector; diff --git a/src/EFCore/Design/Internal/ICSharpRuntimeAnnotationCodeGenerator.cs b/src/EFCore/Design/Internal/ICSharpRuntimeAnnotationCodeGenerator.cs index d79714972b2..93cd123932a 100644 --- a/src/EFCore/Design/Internal/ICSharpRuntimeAnnotationCodeGenerator.cs +++ b/src/EFCore/Design/Internal/ICSharpRuntimeAnnotationCodeGenerator.cs @@ -2,12 +2,18 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Design.Internal { /// /// Implemented by database providers to generate the code for annotations. /// + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// public interface ICSharpRuntimeAnnotationCodeGenerator { /// diff --git a/src/EFCore/Diagnostics/IDbContextLogger.cs b/src/EFCore/Diagnostics/IDbContextLogger.cs index 6f383ab77a1..b1793cf42e8 100644 --- a/src/EFCore/Diagnostics/IDbContextLogger.cs +++ b/src/EFCore/Diagnostics/IDbContextLogger.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Microsoft.EntityFrameworkCore.Diagnostics @@ -11,7 +12,15 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// Used by /// /// - /// See EF Core simple logging for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See EF Core simple logging for more information. + /// /// public interface IDbContextLogger { diff --git a/src/EFCore/Diagnostics/IInterceptorAggregator.cs b/src/EFCore/Diagnostics/IInterceptorAggregator.cs index 93d45a1feed..74c5cd9b27e 100644 --- a/src/EFCore/Diagnostics/IInterceptorAggregator.cs +++ b/src/EFCore/Diagnostics/IInterceptorAggregator.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -22,6 +23,13 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// interfaces. /// /// + /// The service lifetime is and multiple registrations + /// are allowed. This means that each instance will use its own + /// set of instances of this service. + /// The implementations may depend on other services registered with any lifetime. + /// The implementations do not need to be thread-safe. + /// + /// /// See EF Core interceptors for more information. /// /// diff --git a/src/EFCore/Diagnostics/InterceptorAggregator.cs b/src/EFCore/Diagnostics/InterceptorAggregator.cs index 6fedb351605..0bd33fbe9b2 100644 --- a/src/EFCore/Diagnostics/InterceptorAggregator.cs +++ b/src/EFCore/Diagnostics/InterceptorAggregator.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore.Utilities; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -12,7 +13,16 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// Abstract base class for implementations of the service. /// /// - /// See EF Core interceptors for more information. + /// + /// The service lifetime is and multiple registrations + /// are allowed. This means that each instance will use its own + /// set of instances of this service. + /// The implementations may depend on other services registered with any lifetime. + /// The implementations do not need to be thread-safe. + /// + /// + /// See EF Core interceptors for more information. + /// /// /// The interceptor type. public abstract class InterceptorAggregator : IInterceptorAggregator diff --git a/src/EFCore/Diagnostics/Internal/DiagnosticsLogger.cs b/src/EFCore/Diagnostics/Internal/DiagnosticsLogger.cs index 60c1f56bfea..12458bf3001 100644 --- a/src/EFCore/Diagnostics/Internal/DiagnosticsLogger.cs +++ b/src/EFCore/Diagnostics/Internal/DiagnosticsLogger.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Microsoft.EntityFrameworkCore.Diagnostics.Internal @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class DiagnosticsLogger : IDiagnosticsLogger where TLoggerCategory : LoggerCategory, new() { diff --git a/src/EFCore/Diagnostics/Internal/LoggingOptions.cs b/src/EFCore/Diagnostics/Internal/LoggingOptions.cs index 2d3478b938c..fcdacf8785b 100644 --- a/src/EFCore/Diagnostics/Internal/LoggingOptions.cs +++ b/src/EFCore/Diagnostics/Internal/LoggingOptions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics.Internal { @@ -14,11 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class LoggingOptions : ILoggingOptions { /// diff --git a/src/EFCore/Diagnostics/LoggingDefinitions.cs b/src/EFCore/Diagnostics/LoggingDefinitions.cs index 223846f02f8..43e26198ae8 100644 --- a/src/EFCore/Diagnostics/LoggingDefinitions.cs +++ b/src/EFCore/Diagnostics/LoggingDefinitions.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Diagnostics { @@ -16,8 +17,15 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public abstract class LoggingDefinitions { diff --git a/src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs b/src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs index c9826c578c5..cd013e222f8 100644 --- a/src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs +++ b/src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs @@ -150,6 +150,7 @@ public static readonly IDictionary CoreServices { typeof(ISingletonOptions), new ServiceCharacteristics(ServiceLifetime.Singleton, multipleRegistrations: true) }, { typeof(IConventionSetPlugin), new ServiceCharacteristics(ServiceLifetime.Scoped, multipleRegistrations: true) }, { typeof(IResettableService), new ServiceCharacteristics(ServiceLifetime.Scoped, multipleRegistrations: true) }, + { typeof(IInterceptor), new ServiceCharacteristics(ServiceLifetime.Scoped, multipleRegistrations: true) }, { typeof(IInterceptorAggregator), new ServiceCharacteristics(ServiceLifetime.Scoped, multipleRegistrations: true) } }; diff --git a/src/EFCore/Infrastructure/Internal/ConcurrencyDetector.cs b/src/EFCore/Infrastructure/Internal/ConcurrencyDetector.cs index 124a61a472a..19e53b8548b 100644 --- a/src/EFCore/Infrastructure/Internal/ConcurrencyDetector.cs +++ b/src/EFCore/Infrastructure/Internal/ConcurrencyDetector.cs @@ -5,7 +5,6 @@ using System.Threading; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class ConcurrencyDetector : IConcurrencyDetector { private int _inCriticalSection; diff --git a/src/EFCore/Infrastructure/Internal/CoreSingletonOptions.cs b/src/EFCore/Infrastructure/Internal/CoreSingletonOptions.cs index 3c19f712cca..180296127c1 100644 --- a/src/EFCore/Infrastructure/Internal/CoreSingletonOptions.cs +++ b/src/EFCore/Infrastructure/Internal/CoreSingletonOptions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal { @@ -14,11 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class CoreSingletonOptions : ICoreSingletonOptions { /// diff --git a/src/EFCore/Infrastructure/Internal/CurrentDbContext.cs b/src/EFCore/Infrastructure/Internal/CurrentDbContext.cs index eeb34bf4501..e8743707f89 100644 --- a/src/EFCore/Infrastructure/Internal/CurrentDbContext.cs +++ b/src/EFCore/Infrastructure/Internal/CurrentDbContext.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public sealed class CurrentDbContext : ICurrentDbContext { /// diff --git a/src/EFCore/Infrastructure/Internal/DbSetFinder.cs b/src/EFCore/Infrastructure/Internal/DbSetFinder.cs index 487b7a899a7..8c49121baf9 100644 --- a/src/EFCore/Infrastructure/Internal/DbSetFinder.cs +++ b/src/EFCore/Infrastructure/Internal/DbSetFinder.cs @@ -7,7 +7,6 @@ using System.Linq; using System.Reflection; using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class DbSetFinder : IDbSetFinder { private readonly ConcurrentDictionary> _cache = new(); diff --git a/src/EFCore/Infrastructure/Internal/LazyLoader.cs b/src/EFCore/Infrastructure/Internal/LazyLoader.cs index fc0a249332b..019eb148f97 100644 --- a/src/EFCore/Infrastructure/Internal/LazyLoader.cs +++ b/src/EFCore/Infrastructure/Internal/LazyLoader.cs @@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal { @@ -19,12 +18,6 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure.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. /// - /// - /// The service lifetime is . This means that each - /// entity instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class LazyLoader : ILazyLoader { private bool _disposed; diff --git a/src/EFCore/Internal/DbContextServices.cs b/src/EFCore/Internal/DbContextServices.cs index 0dd9493ad23..d7d1a090743 100644 --- a/src/EFCore/Internal/DbContextServices.cs +++ b/src/EFCore/Internal/DbContextServices.cs @@ -19,12 +19,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class DbContextServices : IDbContextServices { private IServiceProvider? _scopedProvider; diff --git a/src/EFCore/Internal/DbSetInitializer.cs b/src/EFCore/Internal/DbSetInitializer.cs index d9b4a51bb09..d522d6f78ed 100644 --- a/src/EFCore/Internal/DbSetInitializer.cs +++ b/src/EFCore/Internal/DbSetInitializer.cs @@ -3,7 +3,6 @@ using System.Linq; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Internal { @@ -13,11 +12,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class DbSetInitializer : IDbSetInitializer { private readonly IDbSetFinder _setFinder; diff --git a/src/EFCore/Internal/DbSetSource.cs b/src/EFCore/Internal/DbSetSource.cs index 4b839722f3b..6ecfb7203ee 100644 --- a/src/EFCore/Internal/DbSetSource.cs +++ b/src/EFCore/Internal/DbSetSource.cs @@ -5,7 +5,6 @@ using System.Collections.Concurrent; using System.Reflection; using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Internal { @@ -15,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class DbSetSource : IDbSetSource { private static readonly MethodInfo _genericCreateSet diff --git a/src/EFCore/Internal/EntityFinderSource.cs b/src/EFCore/Internal/EntityFinderSource.cs index 99d620ba8c3..0a7a5e93044 100644 --- a/src/EFCore/Internal/EntityFinderSource.cs +++ b/src/EFCore/Internal/EntityFinderSource.cs @@ -7,7 +7,6 @@ using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Internal { @@ -17,11 +16,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class EntityFinderSource : IEntityFinderSource { private static readonly MethodInfo _genericCreate diff --git a/src/EFCore/Internal/RegisteredServices.cs b/src/EFCore/Internal/RegisteredServices.cs index adc97d4c8a5..938f6373309 100644 --- a/src/EFCore/Internal/RegisteredServices.cs +++ b/src/EFCore/Internal/RegisteredServices.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Internal { @@ -13,11 +12,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class RegisteredServices : IRegisteredServices { /// diff --git a/src/EFCore/Internal/SingletonOptionsInitializer.cs b/src/EFCore/Internal/SingletonOptionsInitializer.cs index 46777249bf1..f62ea67e123 100644 --- a/src/EFCore/Internal/SingletonOptionsInitializer.cs +++ b/src/EFCore/Internal/SingletonOptionsInitializer.cs @@ -14,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class SingletonOptionsInitializer : ISingletonOptionsInitializer { private volatile bool _isInitialized; diff --git a/src/EFCore/Metadata/Conventions/Infrastructure/IConventionSetPlugin.cs b/src/EFCore/Metadata/Conventions/Infrastructure/IConventionSetPlugin.cs index e1164bacb85..63aef60ef55 100644 --- a/src/EFCore/Metadata/Conventions/Infrastructure/IConventionSetPlugin.cs +++ b/src/EFCore/Metadata/Conventions/Infrastructure/IConventionSetPlugin.cs @@ -20,8 +20,8 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure /// is intended only for non-provider extensions that need to customize conventions. /// /// - /// The service lifetime is and multiple registrations - /// are allowed. This means that each instance will use its own + /// The service lifetime is and multiple registrations + /// are allowed. This means that each instance will use its own /// set of instances of this service. /// The implementations may depend on other services registered with any lifetime. /// The implementations do not need to be thread-safe. diff --git a/src/EFCore/Metadata/Conventions/Internal/RuntimeConventionSetBuilder.cs b/src/EFCore/Metadata/Conventions/Internal/RuntimeConventionSetBuilder.cs index 0e757c64af4..8ceb6d9eb80 100644 --- a/src/EFCore/Metadata/Conventions/Internal/RuntimeConventionSetBuilder.cs +++ b/src/EFCore/Metadata/Conventions/Internal/RuntimeConventionSetBuilder.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal { @@ -14,13 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means that each instance will use its own - /// set of instances of this service. - /// The implementations may depend on other services registered with any lifetime. - /// The implementations do not need to be thread-safe. - /// public class RuntimeConventionSetBuilder : IConventionSetBuilder { private readonly IProviderConventionSetBuilder _conventionSetBuilder; diff --git a/src/EFCore/Metadata/Internal/ConstructorBindingFactory.cs b/src/EFCore/Metadata/Internal/ConstructorBindingFactory.cs index 5cb6da52e47..8afcf5125bf 100644 --- a/src/EFCore/Metadata/Internal/ConstructorBindingFactory.cs +++ b/src/EFCore/Metadata/Internal/ConstructorBindingFactory.cs @@ -8,7 +8,6 @@ using System.Reflection; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -18,11 +17,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class ConstructorBindingFactory : IConstructorBindingFactory { private readonly IPropertyParameterBindingFactory _propertyFactory; diff --git a/src/EFCore/Metadata/Internal/EntityTypeParameterBindingFactory.cs b/src/EFCore/Metadata/Internal/EntityTypeParameterBindingFactory.cs index b0c6c7ee50c..16951a862b9 100644 --- a/src/EFCore/Metadata/Internal/EntityTypeParameterBindingFactory.cs +++ b/src/EFCore/Metadata/Internal/EntityTypeParameterBindingFactory.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -13,12 +12,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is and multiple registrations - /// are allowed. This means a single instance of each service is used by many - /// instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class EntityTypeParameterBindingFactory : IParameterBindingFactory { /// diff --git a/src/EFCore/Metadata/Internal/IRuntimeModel.cs b/src/EFCore/Metadata/Internal/IRuntimeModel.cs index ba5786311f5..a6d2194b393 100644 --- a/src/EFCore/Metadata/Internal/IRuntimeModel.cs +++ b/src/EFCore/Metadata/Internal/IRuntimeModel.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.Extensions.DependencyInjection; + namespace Microsoft.EntityFrameworkCore.Metadata.Internal { /// @@ -9,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.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. /// + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// public interface IRuntimeModel : IModel { /// diff --git a/src/EFCore/Metadata/Internal/MemberClassifier.cs b/src/EFCore/Metadata/Internal/MemberClassifier.cs index 02eccadbef7..44a9aebcb21 100644 --- a/src/EFCore/Metadata/Internal/MemberClassifier.cs +++ b/src/EFCore/Metadata/Internal/MemberClassifier.cs @@ -10,7 +10,6 @@ using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -20,11 +19,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class MemberClassifier : IMemberClassifier { private readonly ITypeMappingSource _typeMappingSource; diff --git a/src/EFCore/Metadata/Internal/Model.cs b/src/EFCore/Metadata/Internal/Model.cs index db1b69e5edd..f6e4511fafe 100644 --- a/src/EFCore/Metadata/Internal/Model.cs +++ b/src/EFCore/Metadata/Internal/Model.cs @@ -15,7 +15,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Conventions; using Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -25,12 +24,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class Model : ConventionAnnotatable, IMutableModel, IConventionModel, IRuntimeModel { /// diff --git a/src/EFCore/Metadata/Internal/ParameterBindingFactories.cs b/src/EFCore/Metadata/Internal/ParameterBindingFactories.cs index c6f3d92e006..38b1d0cce90 100644 --- a/src/EFCore/Metadata/Internal/ParameterBindingFactories.cs +++ b/src/EFCore/Metadata/Internal/ParameterBindingFactories.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -15,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class ParameterBindingFactories : IParameterBindingFactories { private readonly IRegisteredServices _registeredServices; diff --git a/src/EFCore/Metadata/Internal/PropertyParameterBindingFactory.cs b/src/EFCore/Metadata/Internal/PropertyParameterBindingFactory.cs index 8c925f6462e..18d61e6d174 100644 --- a/src/EFCore/Metadata/Internal/PropertyParameterBindingFactory.cs +++ b/src/EFCore/Metadata/Internal/PropertyParameterBindingFactory.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata.Internal { @@ -14,11 +13,6 @@ namespace Microsoft.EntityFrameworkCore.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class PropertyParameterBindingFactory : IPropertyParameterBindingFactory { /// diff --git a/src/EFCore/Metadata/RuntimeModel.cs b/src/EFCore/Metadata/RuntimeModel.cs index b60a753bd01..fde49f09832 100644 --- a/src/EFCore/Metadata/RuntimeModel.cs +++ b/src/EFCore/Metadata/RuntimeModel.cs @@ -13,6 +13,7 @@ using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Metadata { @@ -27,6 +28,12 @@ namespace Microsoft.EntityFrameworkCore.Metadata /// This is a light-weight implementation that is constructed from a built model and is not meant to be used at design-time. /// /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// /// See Modeling entity types and relationships for more information. /// /// diff --git a/src/EFCore/Query/INavigationExpansionExtensibilityHelper.cs b/src/EFCore/Query/INavigationExpansionExtensibilityHelper.cs index c8d81479d32..fe852694a48 100644 --- a/src/EFCore/Query/INavigationExpansionExtensibilityHelper.cs +++ b/src/EFCore/Query/INavigationExpansionExtensibilityHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query { @@ -9,8 +10,15 @@ namespace Microsoft.EntityFrameworkCore.Query /// Service which helps with various aspects of navigation expansion extensibility. /// /// - /// See Implementation of database providers and extensions - /// and How EF Core queries work for more information. + /// + /// The service lifetime is . This means a single instance + /// is used by many instances. The implementation must be thread-safe. + /// This service cannot depend on services registered as . + /// + /// + /// See Implementation of database providers and extensions + /// and How EF Core queries work for more information. + /// /// public interface INavigationExpansionExtensibilityHelper { diff --git a/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs index fbbdc5c7e24..22de546f1a0 100644 --- a/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -10,9 +10,10 @@ namespace Microsoft.EntityFrameworkCore.Query /// /// /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. /// /// /// See Implementation of database providers and extensions diff --git a/src/EFCore/Query/Internal/CompiledQueryCache.cs b/src/EFCore/Query/Internal/CompiledQueryCache.cs index 20c7e969bde..975f0c9f1fe 100644 --- a/src/EFCore/Query/Internal/CompiledQueryCache.cs +++ b/src/EFCore/Query/Internal/CompiledQueryCache.cs @@ -5,7 +5,6 @@ using System.Collections.Concurrent; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -15,11 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class CompiledQueryCache : ICompiledQueryCache { private static readonly ConcurrentDictionary _locks = new(); diff --git a/src/EFCore/Query/Internal/EntityMaterializerSource.cs b/src/EFCore/Query/Internal/EntityMaterializerSource.cs index 23f12c4da07..46a072d87a8 100644 --- a/src/EFCore/Query/Internal/EntityMaterializerSource.cs +++ b/src/EFCore/Query/Internal/EntityMaterializerSource.cs @@ -12,7 +12,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -22,11 +21,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class EntityMaterializerSource : IEntityMaterializerSource { private ConcurrentDictionary>? _materializers; diff --git a/src/EFCore/Query/Internal/EntityQueryProvider.cs b/src/EFCore/Query/Internal/EntityQueryProvider.cs index 811cfb383c6..e1eaba7c4dd 100644 --- a/src/EFCore/Query/Internal/EntityQueryProvider.cs +++ b/src/EFCore/Query/Internal/EntityQueryProvider.cs @@ -6,7 +6,6 @@ using System.Linq.Expressions; using System.Reflection; using System.Threading; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -16,12 +15,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class EntityQueryProvider : IAsyncQueryProvider { private static readonly MethodInfo _genericCreateQueryMethod diff --git a/src/EFCore/Query/Internal/NullAsyncQueryProvider.cs b/src/EFCore/Query/Internal/NullAsyncQueryProvider.cs index ed6dd529eeb..970a3d5caa7 100644 --- a/src/EFCore/Query/Internal/NullAsyncQueryProvider.cs +++ b/src/EFCore/Query/Internal/NullAsyncQueryProvider.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -15,12 +14,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class NullAsyncQueryProvider : IAsyncQueryProvider { /// diff --git a/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs b/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs index ba468e95cfa..d6a8045e746 100644 --- a/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs +++ b/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class QueryCompilationContextFactory : IQueryCompilationContextFactory { /// diff --git a/src/EFCore/Query/Internal/QueryCompiler.cs b/src/EFCore/Query/Internal/QueryCompiler.cs index c91a62e3b26..fa7cc821dd0 100644 --- a/src/EFCore/Query/Internal/QueryCompiler.cs +++ b/src/EFCore/Query/Internal/QueryCompiler.cs @@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -19,12 +18,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class QueryCompiler : IQueryCompiler { private readonly IQueryContextFactory _queryContextFactory; diff --git a/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs b/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs index a5c4aa595aa..3297b82c9f1 100644 --- a/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs +++ b/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,11 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class QueryTranslationPostprocessorFactory : IQueryTranslationPostprocessorFactory { /// diff --git a/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs b/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs index 58622bc6b4f..8c3d2ea8379 100644 --- a/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs +++ b/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Query.Internal { @@ -12,11 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Query.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. /// - /// - /// The service lifetime is . This means a single instance - /// is used by many instances. The implementation must be thread-safe. - /// This service cannot depend on services registered as . - /// public class QueryTranslationPreprocessorFactory : IQueryTranslationPreprocessorFactory { /// diff --git a/src/EFCore/Storage/ExecutionStrategy.cs b/src/EFCore/Storage/ExecutionStrategy.cs index 9cd6f046a16..5238d110986 100644 --- a/src/EFCore/Storage/ExecutionStrategy.cs +++ b/src/EFCore/Storage/ExecutionStrategy.cs @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Utilities; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage { @@ -16,8 +17,16 @@ namespace Microsoft.EntityFrameworkCore.Storage /// The base class for implementations. /// /// - /// See Connection resiliency and database retries - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Connection resiliency and database retries + /// for more information. + /// /// public abstract class ExecutionStrategy : IExecutionStrategy { diff --git a/src/EFCore/Storage/IDatabaseCreator.cs b/src/EFCore/Storage/IDatabaseCreator.cs index fdf43900491..c0d1e85f006 100644 --- a/src/EFCore/Storage/IDatabaseCreator.cs +++ b/src/EFCore/Storage/IDatabaseCreator.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage { @@ -17,8 +18,16 @@ namespace Microsoft.EntityFrameworkCore.Storage /// /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public interface IDatabaseCreator { diff --git a/src/EFCore/Storage/Internal/DatabaseFacadeDependencies.cs b/src/EFCore/Storage/Internal/DatabaseFacadeDependencies.cs index 19f42ea5044..3b0972d3f23 100644 --- a/src/EFCore/Storage/Internal/DatabaseFacadeDependencies.cs +++ b/src/EFCore/Storage/Internal/DatabaseFacadeDependencies.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage.Internal { @@ -14,12 +13,6 @@ namespace Microsoft.EntityFrameworkCore.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public record DatabaseFacadeDependencies : IDatabaseFacadeDependencies { /// diff --git a/src/EFCore/Storage/Internal/ExecutionStrategyFactory.cs b/src/EFCore/Storage/Internal/ExecutionStrategyFactory.cs index cba75856737..100b871b487 100644 --- a/src/EFCore/Storage/Internal/ExecutionStrategyFactory.cs +++ b/src/EFCore/Storage/Internal/ExecutionStrategyFactory.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage.Internal { @@ -12,12 +11,6 @@ namespace Microsoft.EntityFrameworkCore.Storage.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. /// - /// - /// The service lifetime is . This means that each - /// instance will use its own instance of this service. - /// The implementation may depend on other services registered with any lifetime. - /// The implementation does not need to be thread-safe. - /// public class ExecutionStrategyFactory : IExecutionStrategyFactory { private readonly NonRetryingExecutionStrategy _instance; diff --git a/src/EFCore/Storage/NonRetryingExecutionStrategy.cs b/src/EFCore/Storage/NonRetryingExecutionStrategy.cs index a12a9d547c1..56b7fc805ef 100644 --- a/src/EFCore/Storage/NonRetryingExecutionStrategy.cs +++ b/src/EFCore/Storage/NonRetryingExecutionStrategy.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Storage { @@ -11,8 +12,16 @@ namespace Microsoft.EntityFrameworkCore.Storage /// An implementation of that does no retries. /// /// - /// See Connection resiliency and database retries - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Connection resiliency and database retries + /// for more information. + /// /// public sealed class NonRetryingExecutionStrategy : IExecutionStrategy { diff --git a/src/EFCore/Update/IUpdateAdapterFactory.cs b/src/EFCore/Update/IUpdateAdapterFactory.cs index fa91dd86084..15cb8c5c052 100644 --- a/src/EFCore/Update/IUpdateAdapterFactory.cs +++ b/src/EFCore/Update/IUpdateAdapterFactory.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.EntityFrameworkCore.Update { @@ -16,8 +17,16 @@ namespace Microsoft.EntityFrameworkCore.Update /// /// /// - /// See Implementation of database providers and extensions - /// for more information. + /// + /// The service lifetime is . This means that each + /// instance will use its own instance of this service. + /// The implementation may depend on other services registered with any lifetime. + /// The implementation does not need to be thread-safe. + /// + /// + /// See Implementation of database providers and extensions + /// for more information. + /// /// public interface IUpdateAdapterFactory {