From 6c3114c92e91598869501fc00dee29e7ec8afee5 Mon Sep 17 00:00:00 2001 From: Smit Patel Date: Wed, 8 Apr 2020 18:13:09 -0700 Subject: [PATCH] Add query documentation in EF Core Enable warning 1591 Will do relational assembly in other pass hence disabled in that csproj. Also, Make EntityMaterializerSource public internal Make QueryableMethods to be shared internal Make IParameterValues public internal --- Directory.Build.props | 5 + .../Internal/CosmosDbOptionExtension.cs | 6 + .../Internal/ICosmosSingletonOptions.cs | 6 + .../Conventions/StoreKeyConvention.cs | 2 + ...osmosProjectionBindingExpressionVisitor.cs | 6 + .../Internal/CosmosQueryCompilationContext.cs | 23 +- .../CosmosQueryCompilationContextFactory.cs | 17 +- ...ueryMetadataExtractingExpressionVisitor.cs | 18 + .../CosmosQueryTranslationPreprocessor.cs | 23 +- ...smosQueryTranslationPreprocessorFactory.cs | 17 +- ...yableMethodTranslatingExpressionVisitor.cs | 4 +- ...osShapedQueryCompilingExpressionVisitor.cs | 2 +- .../Query/Internal/SqlFunctionExpression.cs | 6 + .../Query/Internal/SqlUnaryExpression.cs | 6 + .../Update/Internal/DocumentSource.cs | 8 +- .../Internal/CosmosValueGeneratorSelector.cs | 18 + .../Scaffolding/ScaffoldedFile.cs | 5 + .../Scaffolding/ScaffoldedModel.cs | 4 + .../InMemoryServiceCollectionExtensions.cs | 1 - .../Internal/EntityProjectionExpression.cs | 60 ++++ ...yExpressionTranslatingExpressionVisitor.cs | 102 ++++++ .../InMemoryGroupByShaperExpression.cs | 24 ++ ...emoryProjectionBindingExpressionVisitor.cs | 48 +++ .../Query/Internal/InMemoryQueryExpression.cs | 144 ++++++++ .../InMemoryQueryTranslationPostprocessor.cs | 24 -- ...oryQueryTranslationPostprocessorFactory.cs | 40 --- ...yableMethodTranslatingExpressionVisitor.cs | 256 +++++++++++++- ...thodTranslatingExpressionVisitorFactory.cs | 12 + ...ryShapedQueryCompilingExpressionVisitor.cs | 20 +- ...moryShapedQueryExpressionVisitorFactory.cs | 18 + .../Query/Internal/InMemoryTableExpression.cs | 42 +++ ...erExpressionProcessingExpressionVisitor.cs | 24 ++ .../Internal/SingleResultShaperExpression.cs | 54 +++ .../Storage/Internal/InMemoryTable.cs | 6 + .../EFCore.Relational.csproj | 1 + ...RelationalQueryTranslationPostprocessor.cs | 2 +- .../RelationalQueryTranslationPreprocessor.cs | 4 +- ...yableMethodTranslatingExpressionVisitor.cs | 4 +- ...alShapedQueryCompilingExpressionVisitor.cs | 4 +- ...erverGeometryCollectionMemberTranslator.cs | 18 + ...erverGeometryCollectionMethodTranslator.cs | 18 + .../SqlServerGeometryMemberTranslator.cs | 18 + .../SqlServerGeometryMethodTranslator.cs | 18 + .../SqlServerLineStringMemberTranslator.cs | 18 + .../SqlServerLineStringMethodTranslator.cs | 18 + ...qlServerMultiLineStringMemberTranslator.cs | 18 + .../SqlServerPolygonMemberTranslator.cs | 18 + .../SqlServerPolygonMethodTranslator.cs | 18 + .../SqlServerStoreGenerationConvention.cs | 1 + ...rchConditionConvertingExpressionVisitor.cs | 174 ++++++++++ .../SqlServerByteArrayMethodTranslator.cs | 18 + .../Internal/SqlServerConvertTranslator.cs | 18 + .../SqlServerDataLengthFunctionTranslator.cs | 18 + .../SqlServerDateDiffFunctionsTranslator.cs | 18 + .../SqlServerDateTimeMemberTranslator.cs | 18 + .../SqlServerDateTimeMethodTranslator.cs | 18 + .../SqlServerFromPartsFunctionTranslator.cs | 18 + ...ServerFullTextSearchFunctionsTranslator.cs | 18 + .../SqlServerIsDateFunctionTranslator.cs | 18 + .../Query/Internal/SqlServerMathTranslator.cs | 18 + .../SqlServerMemberTranslatorProvider.cs | 12 + .../SqlServerMethodCallTranslatorProvider.cs | 12 + .../Internal/SqlServerNewGuidTranslator.cs | 18 + .../SqlServerObjectToStringTranslator.cs | 18 + ...meterBasedQueryTranslationPostprocessor.cs | 18 + ...sedQueryTranslationPostprocessorFactory.cs | 18 + .../Internal/SqlServerQuerySqlGenerator.cs | 36 ++ .../SqlServerQuerySqlGeneratorFactory.cs | 18 + ...qlServerSqlTranslatingExpressionVisitor.cs | 30 ++ ...rSqlTranslatingExpressionVisitorFactory.cs | 18 + .../SqlServerStringMemberTranslator.cs | 18 + .../SqlServerStringMethodTranslator.cs | 18 + .../SqlServerTimeSpanMemberTranslator.cs | 18 + .../Internal/SqlServerTypeMappingSource.cs | 7 + .../Internal/SqliteModelValidator.cs | 6 + .../SqliteByteArrayMethodTranslator.cs | 18 + .../Internal/SqliteDateTimeAddTranslator.cs | 18 + .../SqliteDateTimeMemberTranslator.cs | 18 + .../Query/Internal/SqliteMathTranslator.cs | 18 + .../SqliteMemberTranslatorProvider.cs | 12 + .../SqliteMethodCallTranslatorProvider.cs | 12 + .../Query/Internal/SqliteQuerySqlGenerator.cs | 30 ++ .../SqliteQuerySqlGeneratorFactory.cs | 18 + ...yableMethodTranslatingExpressionVisitor.cs | 36 ++ ...thodTranslatingExpressionVisitorFactory.cs | 18 + .../SqliteSqlTranslatingExpressionVisitor.cs | 54 +++ ...eSqlTranslatingExpressionVisitorFactory.cs | 18 + .../Internal/SqliteStringLengthTranslator.cs | 18 + .../Internal/SqliteStringMethodTranslator.cs | 18 + ...qliteGeometryCollectionMemberTranslator.cs | 18 + ...qliteGeometryCollectionMethodTranslator.cs | 18 + .../SqliteGeometryMemberTranslator.cs | 18 + .../SqliteGeometryMethodTranslator.cs | 18 + .../SqliteLineStringMemberTranslator.cs | 18 + .../SqliteLineStringMethodTranslator.cs | 18 + .../SqliteMultiLineStringMemberTranslator.cs | 18 + ...eNetTopologySuiteMemberTranslatorPlugin.cs | 6 + ...TopologySuiteMethodCallTranslatorPlugin.cs | 6 + .../Internal/SqlitePointMemberTranslator.cs | 18 + .../Internal/SqlitePolygonMemberTranslator.cs | 18 + .../Internal/SqlitePolygonMethodTranslator.cs | 18 + src/EFCore/Extensions/EntityTypeExtensions.cs | 5 + src/EFCore/Extensions/IndexExtensions.cs | 3 + .../Infrastructure/CoreOptionsExtension.cs | 2 + .../Infrastructure/ExpressionExtensions.cs | 2 +- .../Infrastructure/IndentedStringBuilder.cs | 2 +- src/EFCore/Infrastructure/ProductInfo.cs | 4 + .../Builders/IConventionNavigationBuilder.cs | 2 + ...yFilterDefiningQueryRewritingConvention.cs | 18 +- src/EFCore/Metadata/Internal/EntityType.cs | 6 + .../Metadata/Internal/PropertyNameComparer.cs | 12 + .../Internal/SkipNavigationComparer.cs | 6 + .../Query/CollectionShaperExpression.cs | 55 ++- src/EFCore/Query/EntityShaperExpression.cs | 59 ++++ .../Query/ExpressionEqualityComparer.cs | 3 + src/EFCore/Query/ExpressionPrinter.cs | 109 +++++- src/EFCore/Query/GroupByShaperExpression.cs | 57 ++- src/EFCore/Query/IParameterValues.cs | 15 - src/EFCore/Query/IPrintableExpression.cs | 14 + .../Query/IQueryCompilationContextFactory.cs | 5 + .../IQueryTranslationPostprocessorFactory.cs | 5 + .../IQueryTranslationPreprocessorFactory.cs | 5 + ...thodTranslatingExpressionVisitorFactory.cs | 5 + ...dQueryCompilingExpressionVisitorFactory.cs | 5 + src/EFCore/Query/IncludeExpression.cs | 35 ++ .../EntityMaterializerSource.cs | 26 +- .../EntityMaterializerSourceDependencies.cs | 2 +- src/EFCore/Query/Internal/Grouping.cs | 64 ---- src/EFCore/Query/Internal/IParameterValues.cs | 33 ++ ...tionExpressionRemovingExpressionVisitor.cs | 12 + ...nExpandingExpressionVisitor.Expressions.cs | 96 ++--- .../NavigationExpandingExpressionVisitor.cs | 50 ++- .../NegationOptimizingExpressionVisitor.cs | 84 ----- .../NullCheckRemovingExpressionVisitor.cs | 12 + .../ParameterExtractingExpressionVisitor.cs | 6 + .../QueryCompilationContextFactory.cs | 17 +- .../QueryOptimizingExpressionVisitor.cs | 18 + .../QueryTranslationPostprocessorFactory.cs | 14 +- .../QueryTranslationPreprocessorFactory.cs | 17 +- ...yableMethodNormalizingExpressionVisitor.cs | 18 + ...SubqueryMemberPushdownExpressionVisitor.cs | 24 ++ ...terializeCollectionNavigationExpression.cs | 30 ++ .../Query/ProjectionBindingExpression.cs | 45 +++ src/EFCore/Query/ProjectionMember.cs | 43 ++- src/EFCore/Query/QueryCompilationContext.cs | 48 +++ src/EFCore/Query/QueryContext.cs | 1 + src/EFCore/Query/QueryRootExpression.cs | 36 ++ .../Query/QueryTranslationPostprocessor.cs | 33 +- .../Query/QueryTranslationPreprocessor.cs | 34 +- ...yableMethodTranslatingExpressionVisitor.cs | 328 +++++++++++++++++- .../Query/ReplacingExpressionVisitor.cs | 24 ++ src/EFCore/Query/ResultCardinality.cs | 22 +- .../ShapedQueryCompilingExpressionVisitor.cs | 48 ++- src/EFCore/Query/ShapedQueryExpression.cs | 48 ++- .../Query/TransparentIdentifierFactory.cs | 17 +- src/EFCore/Storage/Database.cs | 1 + src/EFCore/Storage/IDatabase.cs | 7 + .../Query => Shared}/QueryableMethods.cs | 2 +- test/Directory.Build.props | 2 +- test/EFCore.Tests/DbContextServicesTest.cs | 1 + .../Internal/EntityMaterializerSourceTest.cs | 1 + ...ntityMaterializerSourceDependenciesTest.cs | 2 +- 162 files changed, 3665 insertions(+), 381 deletions(-) delete mode 100644 src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessor.cs delete mode 100644 src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessorFactory.cs delete mode 100644 src/EFCore/Query/IParameterValues.cs rename src/EFCore/Query/{ => Internal}/EntityMaterializerSource.cs (75%) rename src/EFCore/Query/{ => Internal}/EntityMaterializerSourceDependencies.cs (98%) delete mode 100644 src/EFCore/Query/Internal/Grouping.cs create mode 100644 src/EFCore/Query/Internal/IParameterValues.cs delete mode 100644 src/EFCore/Query/Internal/NegationOptimizingExpressionVisitor.cs rename src/{EFCore/Query => Shared}/QueryableMethods.cs (99%) diff --git a/Directory.Build.props b/Directory.Build.props index 48db10c2aad..626b05f182d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,6 +26,11 @@ https://docs.microsoft.com/ef/core/ + + + $(NoWarn.Replace(';1591', '')) + + diff --git a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosDbOptionExtension.cs b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosDbOptionExtension.cs index 76ebf39fc0e..37b8bf33def 100644 --- a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosDbOptionExtension.cs +++ b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosDbOptionExtension.cs @@ -215,6 +215,12 @@ public virtual CosmosOptionsExtension WithExecutionStrategyFactory( /// protected virtual CosmosOptionsExtension Clone() => new CosmosOptionsExtension(this); + /// + /// 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 virtual void ApplyServices(IServiceCollection services) => services.AddEntityFrameworkCosmos(); diff --git a/src/EFCore.Cosmos/Infrastructure/Internal/ICosmosSingletonOptions.cs b/src/EFCore.Cosmos/Infrastructure/Internal/ICosmosSingletonOptions.cs index 7f6b652e14f..56546608e5b 100644 --- a/src/EFCore.Cosmos/Infrastructure/Internal/ICosmosSingletonOptions.cs +++ b/src/EFCore.Cosmos/Infrastructure/Internal/ICosmosSingletonOptions.cs @@ -47,6 +47,12 @@ public interface ICosmosSingletonOptions : ISingletonOptions /// string Region { 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. + /// ConnectionMode? ConnectionMode { get; } } } diff --git a/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs b/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs index 68a982035ab..1558c0898b3 100644 --- a/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs +++ b/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs @@ -28,8 +28,10 @@ public class StoreKeyConvention : IEntityTypeAnnotationChangedConvention, IEntityTypeBaseTypeChangedConvention { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public static readonly string IdPropertyName = "id"; public static readonly string JObjectPropertyName = "__jObject"; +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member /// /// Creates a new instance of . diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosProjectionBindingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosProjectionBindingExpressionVisitor.cs index 7874745cad4..542fb4fbd6a 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosProjectionBindingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosProjectionBindingExpressionVisitor.cs @@ -264,6 +264,12 @@ protected override Expression VisitMember(MemberExpression memberExpression) } } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs index e8f13debbe5..270e8c0173d 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs @@ -6,15 +6,32 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { + /// + /// 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 class CosmosQueryCompilationContext : QueryCompilationContext { - public virtual string PartitionKey { get; internal set; } - + /// + /// 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 CosmosQueryCompilationContext( [NotNull] QueryCompilationContextDependencies dependencies, bool async) : base(dependencies, async) { - } + + /// + /// 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 virtual string PartitionKey { get; internal set; } } } diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs index 1aadaca13b4..f9b76a9125f 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs @@ -10,7 +10,10 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { /// /// - /// A factory for creating instances. + /// 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. /// /// /// The service lifetime is . This means that each @@ -23,12 +26,24 @@ public class CosmosQueryCompilationContextFactory : IQueryCompilationContextFact { private readonly QueryCompilationContextDependencies _dependencies; + /// + /// 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 CosmosQueryCompilationContextFactory([NotNull] QueryCompilationContextDependencies dependencies) { Check.NotNull(dependencies, nameof(dependencies)); _dependencies = dependencies; } + /// + /// 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 virtual QueryCompilationContext Create(bool async) => new CosmosQueryCompilationContext(_dependencies, async); } diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs index 84868860944..78702d05f55 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs @@ -7,16 +7,34 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { + /// + /// 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 class CosmosQueryMetadataExtractingExpressionVisitor : ExpressionVisitor { private readonly CosmosQueryCompilationContext _cosmosQueryCompilationContext; + /// + /// 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 CosmosQueryMetadataExtractingExpressionVisitor([NotNull] CosmosQueryCompilationContext cosmosQueryCompilationContext) { Check.NotNull(cosmosQueryCompilationContext, nameof(cosmosQueryCompilationContext)); _cosmosQueryCompilationContext = cosmosQueryCompilationContext; } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { if (methodCallExpression.Method.IsGenericMethod diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessor.cs index f8784a00fcd..f8396f30493 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessor.cs @@ -7,11 +7,22 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { + /// + /// 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 class CosmosQueryTranslationPreprocessor : QueryTranslationPreprocessor { - private readonly CosmosQueryCompilationContext _queryCompilationContext; + /// + /// 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 CosmosQueryTranslationPreprocessor( [NotNull] QueryTranslationPreprocessorDependencies dependencies, [NotNull] CosmosQueryCompilationContext cosmosQueryCompilationContext) @@ -20,9 +31,15 @@ public CosmosQueryTranslationPreprocessor( _queryCompilationContext = cosmosQueryCompilationContext; } - public override Expression NormalizeQueryableMethodCall(Expression 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. + /// + public override Expression NormalizeQueryableMethod(Expression query) { - query = base.NormalizeQueryableMethodCall(query); + query = base.NormalizeQueryableMethod(query); query = new CosmosQueryMetadataExtractingExpressionVisitor(_queryCompilationContext).Visit(query); diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessorFactory.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessorFactory.cs index b77772b246f..b147f824343 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessorFactory.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPreprocessorFactory.cs @@ -10,7 +10,10 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal { /// /// - /// A factory for creating instances. + /// 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. /// /// /// The service lifetime is . This means a single instance @@ -22,6 +25,12 @@ public class CosmosQueryTranslationPreprocessorFactory : IQueryTranslationPrepro { private readonly QueryTranslationPreprocessorDependencies _dependencies; + /// + /// 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 CosmosQueryTranslationPreprocessorFactory( [NotNull] QueryTranslationPreprocessorDependencies dependencies) { @@ -29,6 +38,12 @@ public CosmosQueryTranslationPreprocessorFactory( _dependencies = dependencies; } + /// + /// 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 virtual QueryTranslationPreprocessor Create(QueryCompilationContext queryCompilationContext) => new CosmosQueryTranslationPreprocessor(_dependencies, (CosmosQueryCompilationContext)queryCompilationContext); } diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs index 8d5c3e31279..d08b7bc8565 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs @@ -40,7 +40,7 @@ public CosmosQueryableMethodTranslatingExpressionVisitor( [NotNull] ISqlExpressionFactory sqlExpressionFactory, [NotNull] IMemberTranslatorProvider memberTranslatorProvider, [NotNull] IMethodCallTranslatorProvider methodCallTranslatorProvider) - : base(dependencies, subquery: false) + : base(dependencies, queryCompilationContext, subquery: false) { _model = queryCompilationContext.Model; _sqlExpressionFactory = sqlExpressionFactory; @@ -60,7 +60,7 @@ public CosmosQueryableMethodTranslatingExpressionVisitor( /// protected CosmosQueryableMethodTranslatingExpressionVisitor( [NotNull] CosmosQueryableMethodTranslatingExpressionVisitor parentVisitor) - : base(parentVisitor.Dependencies, subquery: true) + : base(parentVisitor.Dependencies, parentVisitor.QueryCompilationContext, subquery: true) { _model = parentVisitor._model; _sqlExpressionFactory = parentVisitor._sqlExpressionFactory; diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs index 510fd2414dc..1a6e069f401 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs @@ -63,7 +63,7 @@ protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQuery shaperBody = new JObjectInjectingExpressionVisitor() .Visit(shaperBody); shaperBody = InjectEntityMaterializers(shaperBody); - shaperBody = new CosmosProjectionBindingRemovingExpressionVisitor(selectExpression, jObjectParameter, IsTracking) + shaperBody = new CosmosProjectionBindingRemovingExpressionVisitor(selectExpression, jObjectParameter, QueryCompilationContext.IsTracking) .Visit(shaperBody); var shaperLambda = Expression.Lambda( diff --git a/src/EFCore.Cosmos/Query/Internal/SqlFunctionExpression.cs b/src/EFCore.Cosmos/Query/Internal/SqlFunctionExpression.cs index e2074f1e51e..6bfc22ed743 100644 --- a/src/EFCore.Cosmos/Query/Internal/SqlFunctionExpression.cs +++ b/src/EFCore.Cosmos/Query/Internal/SqlFunctionExpression.cs @@ -20,6 +20,12 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal /// public class SqlFunctionExpression : SqlExpression { + /// + /// 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 SqlFunctionExpression( [NotNull] string name, [CanBeNull] IEnumerable arguments, diff --git a/src/EFCore.Cosmos/Query/Internal/SqlUnaryExpression.cs b/src/EFCore.Cosmos/Query/Internal/SqlUnaryExpression.cs index ba625a74559..b3288f1dc08 100644 --- a/src/EFCore.Cosmos/Query/Internal/SqlUnaryExpression.cs +++ b/src/EFCore.Cosmos/Query/Internal/SqlUnaryExpression.cs @@ -64,6 +64,12 @@ public SqlUnaryExpression( /// public virtual SqlExpression Operand { 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. + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); diff --git a/src/EFCore.Cosmos/Update/Internal/DocumentSource.cs b/src/EFCore.Cosmos/Update/Internal/DocumentSource.cs index 426766649ef..07aea22b59d 100644 --- a/src/EFCore.Cosmos/Update/Internal/DocumentSource.cs +++ b/src/EFCore.Cosmos/Update/Internal/DocumentSource.cs @@ -141,7 +141,7 @@ public virtual JObject CreateDocument([NotNull] IUpdateEntry entry, int? ordinal /// public virtual JObject UpdateDocument([NotNull] JObject document, [NotNull] IUpdateEntry entry) => UpdateDocument(document, entry, null); - + /// /// 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 @@ -286,6 +286,12 @@ private IProperty GetOrdinalKeyProperty(IEntityType entityType) => entityType.FindPrimaryKey().Properties.FirstOrDefault(p => p.GetJsonPropertyName().Length == 0 && p.IsOrdinalKeyProperty()); + /// + /// 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 virtual JObject GetCurrentDocument([NotNull] IUpdateEntry entry) => _jObjectProperty != null ? (JObject)(entry.SharedIdentityEntry ?? entry).GetCurrentValue(_jObjectProperty) diff --git a/src/EFCore.Cosmos/ValueGeneration/Internal/CosmosValueGeneratorSelector.cs b/src/EFCore.Cosmos/ValueGeneration/Internal/CosmosValueGeneratorSelector.cs index c85ec68e652..6134eb1b0c1 100644 --- a/src/EFCore.Cosmos/ValueGeneration/Internal/CosmosValueGeneratorSelector.cs +++ b/src/EFCore.Cosmos/ValueGeneration/Internal/CosmosValueGeneratorSelector.cs @@ -8,13 +8,31 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.ValueGeneration.Internal { + /// + /// 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 class CosmosValueGeneratorSelector : ValueGeneratorSelector { + /// + /// 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 CosmosValueGeneratorSelector([NotNull] ValueGeneratorSelectorDependencies dependencies) : base(dependencies) { } + /// + /// 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 override ValueGenerator Create(IProperty property, IEntityType entityType) { var type = property.ClrType.UnwrapNullableType().UnwrapEnumType(); diff --git a/src/EFCore.Design/Scaffolding/ScaffoldedFile.cs b/src/EFCore.Design/Scaffolding/ScaffoldedFile.cs index 74f075faffb..a6a35a74abd 100644 --- a/src/EFCore.Design/Scaffolding/ScaffoldedFile.cs +++ b/src/EFCore.Design/Scaffolding/ScaffoldedFile.cs @@ -12,6 +12,11 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// public class ScaffoldedFile { + /// + /// Creates a new instance of . + /// + /// The path of the scaffolded file. + /// The scaffolded code. public ScaffoldedFile([NotNull] string path, [NotNull] string code) { Path = path; diff --git a/src/EFCore.Design/Scaffolding/ScaffoldedModel.cs b/src/EFCore.Design/Scaffolding/ScaffoldedModel.cs index 7c55b54254e..0cb51853116 100644 --- a/src/EFCore.Design/Scaffolding/ScaffoldedModel.cs +++ b/src/EFCore.Design/Scaffolding/ScaffoldedModel.cs @@ -13,6 +13,10 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding /// public class ScaffoldedModel { + /// + /// Creates a new instance of . + /// + /// The scaffolded context file. public ScaffoldedModel([NotNull] ScaffoldedFile contextFile) { ContextFile = contextFile; diff --git a/src/EFCore.InMemory/Extensions/InMemoryServiceCollectionExtensions.cs b/src/EFCore.InMemory/Extensions/InMemoryServiceCollectionExtensions.cs index 68013dbe8af..bf6354621b4 100644 --- a/src/EFCore.InMemory/Extensions/InMemoryServiceCollectionExtensions.cs +++ b/src/EFCore.InMemory/Extensions/InMemoryServiceCollectionExtensions.cs @@ -60,7 +60,6 @@ public static IServiceCollection AddEntityFrameworkInMemoryDatabase([NotNull] th // New Query pipeline .TryAdd() .TryAdd() - .TryAdd() .TryAdd(p => p.GetService()) .TryAddProviderSpecificServices( b => b diff --git a/src/EFCore.InMemory/Query/Internal/EntityProjectionExpression.cs b/src/EFCore.InMemory/Query/Internal/EntityProjectionExpression.cs index 6e94a0246c3..9a69d7649a7 100644 --- a/src/EFCore.InMemory/Query/Internal/EntityProjectionExpression.cs +++ b/src/EFCore.InMemory/Query/Internal/EntityProjectionExpression.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class EntityProjectionExpression : Expression, IPrintableExpression { private readonly IDictionary _readExpressionMap; @@ -19,6 +25,12 @@ public class EntityProjectionExpression : Expression, IPrintableExpression private readonly IDictionary _navigationExpressionsCache = new Dictionary(); + /// + /// 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 EntityProjectionExpression( [NotNull] IEntityType entityType, [NotNull] IDictionary readExpressionMap) { @@ -26,10 +38,34 @@ public EntityProjectionExpression( _readExpressionMap = readExpressionMap; } + /// + /// 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 virtual IEntityType EntityType { 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. + /// public override Type Type => EntityType.ClrType; + /// + /// 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 override ExpressionType NodeType => ExpressionType.Extension; + /// + /// 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 virtual EntityProjectionExpression UpdateEntityType([NotNull] IEntityType derivedType) { var readExpressionMap = new Dictionary(); @@ -46,6 +82,12 @@ public virtual EntityProjectionExpression UpdateEntityType([NotNull] IEntityType return new EntityProjectionExpression(derivedType, readExpressionMap); } + /// + /// 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 virtual Expression BindProperty([NotNull] IProperty property) { if (!EntityType.IsAssignableFrom(property.DeclaringEntityType) @@ -59,6 +101,12 @@ public virtual Expression BindProperty([NotNull] IProperty property) return _readExpressionMap[property]; } + /// + /// 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 virtual void AddNavigationBinding([NotNull] INavigation navigation, [NotNull] EntityShaperExpression entityShaper) { if (!EntityType.IsAssignableFrom(navigation.DeclaringEntityType) @@ -72,6 +120,12 @@ public virtual void AddNavigationBinding([NotNull] INavigation navigation, [NotN _navigationExpressionsCache[navigation] = entityShaper; } + /// + /// 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 virtual EntityShaperExpression BindNavigation([NotNull] INavigation navigation) { if (!EntityType.IsAssignableFrom(navigation.DeclaringEntityType) @@ -87,6 +141,12 @@ public virtual EntityShaperExpression BindNavigation([NotNull] INavigation navig : null; } + /// + /// 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 virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs b/src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs index ca4788e25eb..787f9b6c211 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs @@ -22,6 +22,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryExpressionTranslatingExpressionVisitor : ExpressionVisitor { private const string _runtimeParameterPrefix = QueryCompilationContext.QueryParameterPrefix + "entity_equality_"; @@ -57,6 +63,12 @@ private static string BuildEscapeRegexCharsPattern(IEnumerable regexSpecia private readonly EntityReferenceFindingExpressionVisitor _entityReferenceFindingExpressionVisitor; private readonly IModel _model; + /// + /// 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 InMemoryExpressionTranslatingExpressionVisitor( [NotNull] QueryCompilationContext queryCompilationContext, [NotNull] QueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor) @@ -67,6 +79,12 @@ public InMemoryExpressionTranslatingExpressionVisitor( _model = queryCompilationContext.Model; } + /// + /// 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 virtual Expression Translate([NotNull] Expression expression) { var result = Visit(expression); @@ -76,6 +94,12 @@ public virtual Expression Translate([NotNull] Expression expression) : result; } + /// + /// 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. + /// protected override Expression VisitBinary(BinaryExpression binaryExpression) { Check.NotNull(binaryExpression, nameof(binaryExpression)); @@ -139,6 +163,12 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression) binaryExpression.Conversion); } + /// + /// 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. + /// protected override Expression VisitConditional(ConditionalExpression conditionalExpression) { Check.NotNull(conditionalExpression, nameof(conditionalExpression)); @@ -169,6 +199,12 @@ protected override Expression VisitConditional(ConditionalExpression conditional return Expression.Condition(test, ifTrue, ifFalse); } + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -193,10 +229,34 @@ protected override Expression VisitExtension(Expression extensionExpression) } } + /// + /// 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. + /// protected override Expression VisitInvocation(InvocationExpression invocationExpression) => null; + /// + /// 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. + /// protected override Expression VisitLambda(Expression lambdaExpression) => null; + /// + /// 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. + /// protected override Expression VisitListInit(ListInitExpression listInitExpression) => null; + /// + /// 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. + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -234,6 +294,12 @@ static bool ShouldApplyNullProtectionForMemberAccess(Type callerType, string mem && (memberName == nameof(Nullable.Value) || memberName == nameof(Nullable.HasValue))); } + /// + /// 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. + /// protected override MemberAssignment VisitMemberAssignment(MemberAssignment memberAssignment) { var expression = Visit(memberAssignment.Expression); @@ -250,6 +316,12 @@ protected override MemberAssignment VisitMemberAssignment(MemberAssignment membe return memberAssignment.Update(expression); } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); @@ -549,6 +621,12 @@ MethodInfo GetMethod() return methodCallExpression.Update(@object, arguments); } + /// + /// 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. + /// protected override Expression VisitNew(NewExpression newExpression) { Check.NotNull(newExpression, nameof(newExpression)); @@ -573,6 +651,12 @@ protected override Expression VisitNew(NewExpression newExpression) return newExpression.Update(newArguments); } + /// + /// 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. + /// protected override Expression VisitNewArray(NewArrayExpression newArrayExpression) { Check.NotNull(newArrayExpression, nameof(newArrayExpression)); @@ -597,6 +681,12 @@ protected override Expression VisitNewArray(NewArrayExpression newArrayExpressio return newArrayExpression.Update(newExpressions); } + /// + /// 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. + /// protected override Expression VisitParameter(ParameterExpression parameterExpression) { Check.NotNull(parameterExpression, nameof(parameterExpression)); @@ -612,6 +702,12 @@ protected override Expression VisitParameter(ParameterExpression parameterExpres throw new InvalidOperationException(CoreStrings.TranslationFailed(parameterExpression.Print())); } + /// + /// 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. + /// protected override Expression VisitTypeBinary(TypeBinaryExpression typeBinaryExpression) { Check.NotNull(typeBinaryExpression, nameof(typeBinaryExpression)); @@ -652,6 +748,12 @@ protected override Expression VisitTypeBinary(TypeBinaryExpression typeBinaryExp return Expression.Constant(false); } + /// + /// 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. + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { Check.NotNull(unaryExpression, nameof(unaryExpression)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryGroupByShaperExpression.cs b/src/EFCore.InMemory/Query/Internal/InMemoryGroupByShaperExpression.cs index 694dba96e16..b5e45bdd6f7 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryGroupByShaperExpression.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryGroupByShaperExpression.cs @@ -7,8 +7,20 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryGroupByShaperExpression : GroupByShaperExpression { + /// + /// 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 InMemoryGroupByShaperExpression( [NotNull] Expression keySelector, [NotNull] Expression elementSelector, @@ -20,7 +32,19 @@ public InMemoryGroupByShaperExpression( ValueBufferParameter = valueBufferParameter; } + /// + /// 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 virtual ParameterExpression GroupingParameter { 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. + /// public virtual ParameterExpression ValueBufferParameter { get; } } } diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryProjectionBindingExpressionVisitor.cs b/src/EFCore.InMemory/Query/Internal/InMemoryProjectionBindingExpressionVisitor.cs index bc4f2d75663..6be02d56885 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryProjectionBindingExpressionVisitor.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryProjectionBindingExpressionVisitor.cs @@ -15,6 +15,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryProjectionBindingExpressionVisitor : ExpressionVisitor { private readonly InMemoryQueryableMethodTranslatingExpressionVisitor _queryableMethodTranslatingExpressionVisitor; @@ -28,6 +34,12 @@ private readonly IDictionary _projectionMapping private readonly Stack _projectionMembers = new Stack(); + /// + /// 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 InMemoryProjectionBindingExpressionVisitor( [NotNull] InMemoryQueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor, [NotNull] InMemoryExpressionTranslatingExpressionVisitor expressionTranslatingExpressionVisitor) @@ -36,6 +48,12 @@ public InMemoryProjectionBindingExpressionVisitor( _expressionTranslatingExpressionVisitor = expressionTranslatingExpressionVisitor; } + /// + /// 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 virtual Expression Translate([NotNull] InMemoryQueryExpression queryExpression, [NotNull] Expression expression) { _queryExpression = queryExpression; @@ -64,6 +82,12 @@ public virtual Expression Translate([NotNull] InMemoryQueryExpression queryExpre return result; } + /// + /// 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 override Expression Visit(Expression expression) { if (expression == null) @@ -186,6 +210,12 @@ private CollectionShaperExpression AddCollectionProjection( navigation, elementType); + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -226,6 +256,12 @@ protected override Expression VisitExtension(Expression extensionExpression) throw new InvalidOperationException(CoreStrings.QueryFailed(extensionExpression.Print(), GetType().Name)); } + /// + /// 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. + /// protected override Expression VisitNew(NewExpression newExpression) { Check.NotNull(newExpression, nameof(newExpression)); @@ -265,6 +301,12 @@ protected override Expression VisitNew(NewExpression newExpression) return newExpression.Update(newArguments); } + /// + /// 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. + /// protected override Expression VisitMemberInit(MemberInitExpression memberInitExpression) { Check.NotNull(memberInitExpression, nameof(memberInitExpression)); @@ -293,6 +335,12 @@ protected override Expression VisitMemberInit(MemberInitExpression memberInitExp return memberInitExpression.Update((NewExpression)newExpression, newBindings); } + /// + /// 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. + /// protected override MemberAssignment VisitMemberAssignment(MemberAssignment memberAssignment) { if (_clientEval) diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs index f0233d06739..c533d99d3c5 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs @@ -17,6 +17,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 partial class InMemoryQueryExpression : Expression, IPrintableExpression { private static readonly ConstructorInfo _valueBufferConstructor @@ -35,12 +41,48 @@ private readonly IDictionary _projectionMapping = new Dictionary(); private ParameterExpression _groupingParameter; + /// + /// 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 virtual IReadOnlyList Projection => _valueBufferSlots; + /// + /// 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 virtual Expression ServerQueryExpression { get; private set; } + /// + /// 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 virtual ParameterExpression CurrentParameter => _groupingParameter ?? _valueBufferParameter; + /// + /// 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 override Type Type => typeof(IEnumerable); + /// + /// 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 override ExpressionType NodeType => ExpressionType.Extension; + /// + /// 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 InMemoryQueryExpression([NotNull] IEntityType entityType) { _valueBufferParameter = Parameter(typeof(ValueBuffer), "valueBuffer"); @@ -67,6 +109,12 @@ public InMemoryQueryExpression([NotNull] IEntityType entityType) _projectionMapping[new ProjectionMember()] = entityProjection; } + /// + /// 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 virtual Expression GetSingleScalarProjection() { var expression = CreateReadValueExpression(ServerQueryExpression.Type, 0, null); @@ -78,6 +126,12 @@ public virtual Expression GetSingleScalarProjection() return new ProjectionBindingExpression(this, new ProjectionMember(), expression.Type); } + /// + /// 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 virtual void ConvertToEnumerable() { if (ServerQueryExpression.Type.TryGetSequenceType() == null) @@ -105,6 +159,12 @@ public virtual void ConvertToEnumerable() } } + /// + /// 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 virtual void ReplaceProjectionMapping([NotNull] IDictionary projectionMappings) { _projectionMapping.Clear(); @@ -114,6 +174,12 @@ public virtual void ReplaceProjectionMapping([NotNull] IDictionary + /// 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 virtual IDictionary AddToProjection([NotNull] EntityProjectionExpression entityProjectionExpression) { if (!_entityProjectionCache.TryGetValue(entityProjectionExpression, out var indexMap)) @@ -130,6 +196,12 @@ public virtual IDictionary AddToProjection([NotNull] EntityProje return indexMap; } + /// + /// 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 virtual int AddToProjection([NotNull] Expression expression) { _valueBufferSlots.Add(expression); @@ -137,6 +209,12 @@ public virtual int AddToProjection([NotNull] Expression expression) return _valueBufferSlots.Count - 1; } + /// + /// 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 virtual int AddSubqueryProjection([NotNull] ShapedQueryExpression shapedQueryExpression, [CanBeNull] out Expression innerShaper) { var subquery = (InMemoryQueryExpression)shapedQueryExpression.QueryExpression; @@ -197,12 +275,30 @@ public override Expression Visit(Expression expression) private IEnumerable GetAllPropertiesInHierarchy(IEntityType entityType) => entityType.GetTypesInHierarchy().SelectMany(EntityTypeExtensions.GetDeclaredProperties); + /// + /// 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 virtual Expression GetMappedProjection([NotNull] ProjectionMember member) => _projectionMapping[member]; + /// + /// 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 virtual void UpdateServerQueryExpression([NotNull] Expression serverQueryExpression) => ServerQueryExpression = serverQueryExpression; + /// + /// 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 virtual void PushdownIntoSubquery() { var clientProjection = _valueBufferSlots.Count != 0; @@ -265,6 +361,12 @@ public virtual void PushdownIntoSubquery() } } + /// + /// 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 virtual void ApplyDefaultIfEmpty() { if (_valueBufferSlots.Count != 0) @@ -328,6 +430,12 @@ private static IPropertyBase InferPropertyFromInner(Expression expression) ? (IPropertyBase)((ConstantExpression)methodCallExpression.Arguments[2]).Value : null; + /// + /// 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 virtual void ApplyProjection() { if (_valueBufferSlots.Count == 0) @@ -370,6 +478,12 @@ public virtual void ApplyProjection() selectorLambda); } + /// + /// 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 virtual InMemoryGroupByShaperExpression ApplyGrouping([NotNull] Expression groupingKey, [NotNull] Expression shaperExpression) { PushdownIntoSubquery(); @@ -450,6 +564,12 @@ private Expression GetGroupingKey(Expression key, List groupingExpre private Expression CreateReadValueExpression(Type type, int index, IPropertyBase property) => _valueBufferParameter.CreateValueBufferReadValueExpression(type, index, property); + /// + /// 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 virtual void AddInnerJoin( [NotNull] InMemoryQueryExpression innerQueryExpression, [NotNull] LambdaExpression outerKeySelector, @@ -536,6 +656,12 @@ public virtual void AddInnerJoin( _projectionMapping = projectionMapping; } + /// + /// 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 virtual void AddLeftJoin( [NotNull] InMemoryQueryExpression innerQueryExpression, [NotNull] LambdaExpression outerKeySelector, @@ -664,6 +790,12 @@ public virtual void AddLeftJoin( _projectionMapping = projectionMapping; } + /// + /// 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 virtual void AddSelectMany( [NotNull] InMemoryQueryExpression innerQueryExpression, [CanBeNull] Type transparentIdentifierType, bool innerNullable) { @@ -757,6 +889,12 @@ public virtual void AddSelectMany( _projectionMapping = projectionMapping; } + /// + /// 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 virtual EntityShaperExpression AddNavigationToWeakEntityType( [NotNull] EntityProjectionExpression entityProjectionExpression, [NotNull] INavigation navigation, @@ -900,6 +1038,12 @@ EntityProjectionExpression copyEntityProjectionToOuter(EntityProjectionExpressio return entityShaper; } + /// + /// 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 virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessor.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessor.cs deleted file mode 100644 index d7d21b84a85..00000000000 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Linq.Expressions; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore.Query; - -namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal -{ - public class InMemoryQueryTranslationPostprocessor : QueryTranslationPostprocessor - { - public InMemoryQueryTranslationPostprocessor([NotNull] QueryTranslationPostprocessorDependencies dependencies) - : base(dependencies) - { - } - - public override Expression Process(Expression query) - { - query = base.Process(query); - - return query; - } - } -} diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessorFactory.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessorFactory.cs deleted file mode 100644 index a7474b3d89e..00000000000 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryTranslationPostprocessorFactory.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore.Query; -using Microsoft.EntityFrameworkCore.Utilities; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal -{ - /// - /// - /// 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. - /// - /// - /// 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 InMemoryQueryTranslationPostprocessorFactory : IQueryTranslationPostprocessorFactory - { - private readonly QueryTranslationPostprocessorDependencies _dependencies; - - public InMemoryQueryTranslationPostprocessorFactory([NotNull] QueryTranslationPostprocessorDependencies dependencies) - { - _dependencies = dependencies; - } - - public virtual QueryTranslationPostprocessor Create(QueryCompilationContext queryCompilationContext) - { - Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); - - return new InMemoryQueryTranslationPostprocessor(_dependencies); - } - } -} diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs index 6a467f5de42..fbbc87d663e 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs @@ -17,6 +17,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryQueryableMethodTranslatingExpressionVisitor : QueryableMethodTranslatingExpressionVisitor { private readonly InMemoryExpressionTranslatingExpressionVisitor _expressionTranslator; @@ -24,10 +30,16 @@ public class InMemoryQueryableMethodTranslatingExpressionVisitor : QueryableMeth private readonly InMemoryProjectionBindingExpressionVisitor _projectionBindingExpressionVisitor; private readonly IModel _model; + /// + /// 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 InMemoryQueryableMethodTranslatingExpressionVisitor( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext) - : base(dependencies, subquery: false) + : base(dependencies, queryCompilationContext, subquery: false) { _expressionTranslator = new InMemoryExpressionTranslatingExpressionVisitor(queryCompilationContext, this); _weakEntityExpandingExpressionVisitor = new WeakEntityExpandingExpressionVisitor(_expressionTranslator); @@ -35,9 +47,15 @@ public InMemoryQueryableMethodTranslatingExpressionVisitor( _model = queryCompilationContext.Model; } + /// + /// 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. + /// protected InMemoryQueryableMethodTranslatingExpressionVisitor( [NotNull] InMemoryQueryableMethodTranslatingExpressionVisitor parentVisitor) - : base(parentVisitor.Dependencies, subquery: true) + : base(parentVisitor.Dependencies, parentVisitor.QueryCompilationContext, subquery: true) { _expressionTranslator = parentVisitor._expressionTranslator; _weakEntityExpandingExpressionVisitor = parentVisitor._weakEntityExpandingExpressionVisitor; @@ -45,9 +63,21 @@ protected InMemoryQueryableMethodTranslatingExpressionVisitor( _model = parentVisitor._model; } + /// + /// 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. + /// protected override QueryableMethodTranslatingExpressionVisitor CreateSubqueryVisitor() => new InMemoryQueryableMethodTranslatingExpressionVisitor(this); + /// + /// 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. + /// [Obsolete("Use overload which takes IEntityType.")] protected override ShapedQueryExpression CreateShapedQueryExpression(Type elementType) { @@ -56,6 +86,12 @@ protected override ShapedQueryExpression CreateShapedQueryExpression(Type elemen return CreateShapedQueryExpression(_model.FindEntityType(elementType)); } + /// + /// 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. + /// protected override ShapedQueryExpression CreateShapedQueryExpression(IEntityType entityType) => CreateShapedQueryExpressionStatic(entityType); @@ -74,6 +110,12 @@ private static ShapedQueryExpression CreateShapedQueryExpressionStatic(IEntityTy false)); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateAll(ShapedQueryExpression source, LambdaExpression predicate) { Check.NotNull(source, nameof(source)); @@ -95,6 +137,12 @@ protected override ShapedQueryExpression TranslateAll(ShapedQueryExpression sour return source.UpdateShaperExpression(inMemoryQueryExpression.GetSingleScalarProjection()); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateAny(ShapedQueryExpression source, LambdaExpression predicate) { var inMemoryQueryExpression = (InMemoryQueryExpression)source.QueryExpression; @@ -124,6 +172,12 @@ protected override ShapedQueryExpression TranslateAny(ShapedQueryExpression sour return source.UpdateShaperExpression(inMemoryQueryExpression.GetSingleScalarProjection()); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateAverage(ShapedQueryExpression source, LambdaExpression selector, Type resultType) { Check.NotNull(source, nameof(source)); @@ -132,6 +186,12 @@ protected override ShapedQueryExpression TranslateAverage(ShapedQueryExpression return TranslateScalarAggregate(source, selector, nameof(Enumerable.Average)); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateCast(ShapedQueryExpression source, Type resultType) { Check.NotNull(source, nameof(source)); @@ -142,6 +202,12 @@ protected override ShapedQueryExpression TranslateCast(ShapedQueryExpression sou : source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateConcat(ShapedQueryExpression source1, ShapedQueryExpression source2) { Check.NotNull(source1, nameof(source1)); @@ -150,6 +216,12 @@ protected override ShapedQueryExpression TranslateConcat(ShapedQueryExpression s return TranslateSetOperation(EnumerableMethods.Concat, source1, source2); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateContains(ShapedQueryExpression source, Expression item) { Check.NotNull(source, nameof(source)); @@ -175,6 +247,12 @@ protected override ShapedQueryExpression TranslateContains(ShapedQueryExpression return source.UpdateShaperExpression(inMemoryQueryExpression.GetSingleScalarProjection()); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateCount(ShapedQueryExpression source, LambdaExpression predicate) { Check.NotNull(source, nameof(source)); @@ -206,6 +284,12 @@ protected override ShapedQueryExpression TranslateCount(ShapedQueryExpression so return source.UpdateShaperExpression(inMemoryQueryExpression.GetSingleScalarProjection()); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateDefaultIfEmpty(ShapedQueryExpression source, Expression defaultValue) { Check.NotNull(source, nameof(source)); @@ -219,6 +303,12 @@ protected override ShapedQueryExpression TranslateDefaultIfEmpty(ShapedQueryExpr return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateDistinct(ShapedQueryExpression source) { Check.NotNull(source, nameof(source)); @@ -234,6 +324,12 @@ protected override ShapedQueryExpression TranslateDistinct(ShapedQueryExpression return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateElementAtOrDefault( ShapedQueryExpression source, Expression index, bool returnDefault) { @@ -243,6 +339,12 @@ protected override ShapedQueryExpression TranslateElementAtOrDefault( return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateExcept(ShapedQueryExpression source1, ShapedQueryExpression source2) { Check.NotNull(source1, nameof(source1)); @@ -251,6 +353,12 @@ protected override ShapedQueryExpression TranslateExcept(ShapedQueryExpression s return TranslateSetOperation(EnumerableMethods.Except, source1, source2); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateFirstOrDefault( ShapedQueryExpression source, LambdaExpression predicate, Type returnType, bool returnDefault) { @@ -266,6 +374,12 @@ protected override ShapedQueryExpression TranslateFirstOrDefault( : EnumerableMethods.FirstWithoutPredicate); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateGroupBy( ShapedQueryExpression source, LambdaExpression keySelector, LambdaExpression elementSelector, LambdaExpression resultSelector) { @@ -364,6 +478,12 @@ private Expression TranslateGroupingKey(Expression expression) } } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateGroupJoin( ShapedQueryExpression outer, ShapedQueryExpression inner, @@ -380,6 +500,12 @@ protected override ShapedQueryExpression TranslateGroupJoin( return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateIntersect(ShapedQueryExpression source1, ShapedQueryExpression source2) { Check.NotNull(source1, nameof(source1)); @@ -388,6 +514,12 @@ protected override ShapedQueryExpression TranslateIntersect(ShapedQueryExpressio return TranslateSetOperation(EnumerableMethods.Intersect, source1, source2); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateJoin( ShapedQueryExpression outer, ShapedQueryExpression inner, @@ -514,6 +646,12 @@ static bool IsConvertedToNullable(Expression outer, Expression inner) && outer.Type.UnwrapNullableType() == inner.Type; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateLastOrDefault( ShapedQueryExpression source, LambdaExpression predicate, Type returnType, bool returnDefault) { @@ -529,6 +667,12 @@ protected override ShapedQueryExpression TranslateLastOrDefault( : EnumerableMethods.LastWithoutPredicate); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateLeftJoin( ShapedQueryExpression outer, ShapedQueryExpression inner, LambdaExpression outerKeySelector, LambdaExpression innerKeySelector, LambdaExpression resultSelector) @@ -563,6 +707,12 @@ protected override ShapedQueryExpression TranslateLeftJoin( transparentIdentifierType); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateLongCount( ShapedQueryExpression source, LambdaExpression predicate) { @@ -597,6 +747,12 @@ protected override ShapedQueryExpression TranslateLongCount( return source.UpdateShaperExpression(inMemoryQueryExpression.GetSingleScalarProjection()); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateMax( ShapedQueryExpression source, LambdaExpression selector, Type resultType) { @@ -605,6 +761,12 @@ protected override ShapedQueryExpression TranslateMax( return TranslateScalarAggregate(source, selector, nameof(Enumerable.Max)); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateMin(ShapedQueryExpression source, LambdaExpression selector, Type resultType) { Check.NotNull(source, nameof(source)); @@ -612,6 +774,12 @@ protected override ShapedQueryExpression TranslateMin(ShapedQueryExpression sour return TranslateScalarAggregate(source, selector, nameof(Enumerable.Min)); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateOfType(ShapedQueryExpression source, Type resultType) { Check.NotNull(source, nameof(source)); @@ -680,6 +848,12 @@ protected override ShapedQueryExpression TranslateOfType(ShapedQueryExpression s return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateOrderBy( ShapedQueryExpression source, LambdaExpression keySelector, bool ascending) { @@ -704,6 +878,12 @@ protected override ShapedQueryExpression TranslateOrderBy( return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateReverse(ShapedQueryExpression source) { Check.NotNull(source, nameof(source)); @@ -718,6 +898,12 @@ protected override ShapedQueryExpression TranslateReverse(ShapedQueryExpression return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression source, LambdaExpression selector) { Check.NotNull(source, nameof(source)); @@ -743,6 +929,12 @@ protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression s return source.UpdateShaperExpression(newShaper); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSelectMany( ShapedQueryExpression source, LambdaExpression collectionSelector, LambdaExpression resultSelector) { @@ -803,6 +995,12 @@ protected override Expression VisitMethodCall(MethodCallExpression methodCallExp } } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSelectMany(ShapedQueryExpression source, LambdaExpression selector) { Check.NotNull(source, nameof(source)); @@ -815,6 +1013,12 @@ protected override ShapedQueryExpression TranslateSelectMany(ShapedQueryExpressi return TranslateSelectMany(source, selector, resultSelector); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSingleOrDefault( ShapedQueryExpression source, LambdaExpression predicate, Type returnType, bool returnDefault) { @@ -830,6 +1034,12 @@ protected override ShapedQueryExpression TranslateSingleOrDefault( : EnumerableMethods.SingleWithoutPredicate); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSkip(ShapedQueryExpression source, Expression count) { Check.NotNull(source, nameof(source)); @@ -851,6 +1061,12 @@ protected override ShapedQueryExpression TranslateSkip(ShapedQueryExpression sou return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSkipWhile(ShapedQueryExpression source, LambdaExpression predicate) { Check.NotNull(source, nameof(source)); @@ -859,6 +1075,12 @@ protected override ShapedQueryExpression TranslateSkipWhile(ShapedQueryExpressio return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateSum(ShapedQueryExpression source, LambdaExpression selector, Type resultType) { Check.NotNull(source, nameof(source)); @@ -867,6 +1089,12 @@ protected override ShapedQueryExpression TranslateSum(ShapedQueryExpression sour return TranslateScalarAggregate(source, selector, nameof(Enumerable.Sum)); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateTake(ShapedQueryExpression source, Expression count) { Check.NotNull(source, nameof(source)); @@ -888,6 +1116,12 @@ protected override ShapedQueryExpression TranslateTake(ShapedQueryExpression sou return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateTakeWhile(ShapedQueryExpression source, LambdaExpression predicate) { Check.NotNull(source, nameof(source)); @@ -896,6 +1130,12 @@ protected override ShapedQueryExpression TranslateTakeWhile(ShapedQueryExpressio return null; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateThenBy(ShapedQueryExpression source, LambdaExpression keySelector, bool ascending) { Check.NotNull(source, nameof(source)); @@ -918,6 +1158,12 @@ protected override ShapedQueryExpression TranslateThenBy(ShapedQueryExpression s return source; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateUnion(ShapedQueryExpression source1, ShapedQueryExpression source2) { Check.NotNull(source1, nameof(source1)); @@ -926,6 +1172,12 @@ protected override ShapedQueryExpression TranslateUnion(ShapedQueryExpression so return TranslateSetOperation(EnumerableMethods.Union, source1, source2); } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate) { Check.NotNull(source, nameof(source)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs index a0bd8a89219..6f00cecccad 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -25,12 +25,24 @@ public class InMemoryQueryableMethodTranslatingExpressionVisitorFactory : IQuery { private readonly QueryableMethodTranslatingExpressionVisitorDependencies _dependencies; + /// + /// 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 InMemoryQueryableMethodTranslatingExpressionVisitorFactory( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QueryableMethodTranslatingExpressionVisitor Create(QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.cs index 6d9130f6c81..d7c227ab056 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.cs @@ -19,6 +19,12 @@ public partial class InMemoryShapedQueryCompilingExpressionVisitor : ShapedQuery private readonly Type _contextType; private readonly IDiagnosticsLogger _logger; + /// + /// 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 InMemoryShapedQueryCompilingExpressionVisitor( [NotNull] ShapedQueryCompilingExpressionVisitorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext) @@ -28,6 +34,12 @@ public InMemoryShapedQueryCompilingExpressionVisitor( _logger = queryCompilationContext.Logger; } + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -48,6 +60,12 @@ protected override Expression VisitExtension(Expression extensionExpression) return base.VisitExtension(extensionExpression); } + /// + /// 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. + /// protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQueryExpression) { Check.NotNull(shapedQueryExpression, nameof(shapedQueryExpression)); @@ -64,7 +82,7 @@ protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQuery shaper = new InMemoryProjectionBindingRemovingExpressionVisitor().Visit(shaper); - shaper = new CustomShaperCompilingExpressionVisitor(IsTracking).Visit(shaper); + shaper = new CustomShaperCompilingExpressionVisitor(QueryCompilationContext.IsTracking).Visit(shaper); var shaperLambda = (LambdaExpression)shaper; diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryExpressionVisitorFactory.cs b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryExpressionVisitorFactory.cs index 52f1ce148c1..89eecd3b95b 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryExpressionVisitorFactory.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryExpressionVisitorFactory.cs @@ -7,15 +7,33 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryShapedQueryCompilingExpressionVisitorFactory : IShapedQueryCompilingExpressionVisitorFactory { private readonly ShapedQueryCompilingExpressionVisitorDependencies _dependencies; + /// + /// 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 InMemoryShapedQueryCompilingExpressionVisitorFactory([NotNull] ShapedQueryCompilingExpressionVisitorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual ShapedQueryCompilingExpressionVisitor Create(QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryTableExpression.cs b/src/EFCore.InMemory/Query/Internal/InMemoryTableExpression.cs index e6a13257549..c14885449a1 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryTableExpression.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryTableExpression.cs @@ -12,19 +12,55 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class InMemoryTableExpression : Expression, IPrintableExpression { + /// + /// 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 InMemoryTableExpression([NotNull] IEntityType entityType) { EntityType = entityType; } + /// + /// 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 override Type Type => typeof(IEnumerable); + /// + /// 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 virtual IEntityType EntityType { 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. + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// + /// 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. + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -32,6 +68,12 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return this; } + /// + /// 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 virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore.InMemory/Query/Internal/ShaperExpressionProcessingExpressionVisitor.cs b/src/EFCore.InMemory/Query/Internal/ShaperExpressionProcessingExpressionVisitor.cs index 95851e31118..d87e92ab261 100644 --- a/src/EFCore.InMemory/Query/Internal/ShaperExpressionProcessingExpressionVisitor.cs +++ b/src/EFCore.InMemory/Query/Internal/ShaperExpressionProcessingExpressionVisitor.cs @@ -9,6 +9,12 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class ShaperExpressionProcessingExpressionVisitor : ExpressionVisitor { private readonly InMemoryQueryExpression _queryExpression; @@ -18,6 +24,12 @@ public class ShaperExpressionProcessingExpressionVisitor : ExpressionVisitor private readonly List _variables = new List(); private readonly List _expressions = new List(); + /// + /// 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 ShaperExpressionProcessingExpressionVisitor( [CanBeNull] InMemoryQueryExpression queryExpression, [NotNull] ParameterExpression valueBufferParameter) { @@ -25,6 +37,12 @@ public ShaperExpressionProcessingExpressionVisitor( _valueBufferParameter = valueBufferParameter; } + /// + /// 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 virtual Expression Inject([NotNull] Expression expression) { var result = Visit(expression); @@ -40,6 +58,12 @@ private LambdaExpression ConvertToLambda(Expression result) QueryCompilationContext.QueryContextParameter, _valueBufferParameter); + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); diff --git a/src/EFCore.InMemory/Query/Internal/SingleResultShaperExpression.cs b/src/EFCore.InMemory/Query/Internal/SingleResultShaperExpression.cs index 2911ab5750f..42e50924396 100644 --- a/src/EFCore.InMemory/Query/Internal/SingleResultShaperExpression.cs +++ b/src/EFCore.InMemory/Query/Internal/SingleResultShaperExpression.cs @@ -9,8 +9,20 @@ namespace Microsoft.EntityFrameworkCore.InMemory.Query.Internal { + /// + /// 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 class SingleResultShaperExpression : Expression, IPrintableExpression { + /// + /// 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 SingleResultShaperExpression( [NotNull] Expression projection, [NotNull] Expression innerShaper, @@ -21,6 +33,12 @@ public SingleResultShaperExpression( Type = type; } + /// + /// 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. + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -31,17 +49,53 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(projection, innerShaper); } + /// + /// 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 virtual SingleResultShaperExpression Update([NotNull] Expression projection, [NotNull] Expression innerShaper) => projection != Projection || innerShaper != InnerShaper ? new SingleResultShaperExpression(projection, innerShaper, Type) : this; + /// + /// 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 override ExpressionType NodeType => ExpressionType.Extension; + /// + /// 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 override Type Type { 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. + /// public virtual Expression Projection { 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. + /// public virtual Expression InnerShaper { 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. + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore.InMemory/Storage/Internal/InMemoryTable.cs b/src/EFCore.InMemory/Storage/Internal/InMemoryTable.cs index 5422b68d527..8b1168bf7ff 100644 --- a/src/EFCore.InMemory/Storage/Internal/InMemoryTable.cs +++ b/src/EFCore.InMemory/Storage/Internal/InMemoryTable.cs @@ -292,6 +292,12 @@ public virtual void Update(IUpdateEntry entry) } } + /// + /// 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 virtual void BumpValueGenerators(object[] row) { if (BaseTable != null) diff --git a/src/EFCore.Relational/EFCore.Relational.csproj b/src/EFCore.Relational/EFCore.Relational.csproj index 7acf0d15c3a..a3f06ae17e0 100644 --- a/src/EFCore.Relational/EFCore.Relational.csproj +++ b/src/EFCore.Relational/EFCore.Relational.csproj @@ -7,6 +7,7 @@ Microsoft.EntityFrameworkCore.Relational Microsoft.EntityFrameworkCore true + $(NoWarn);1591 ..\..\EFCore.ruleset diff --git a/src/EFCore.Relational/Query/RelationalQueryTranslationPostprocessor.cs b/src/EFCore.Relational/Query/RelationalQueryTranslationPostprocessor.cs index ef7abb5ab3a..aeecd8bd248 100644 --- a/src/EFCore.Relational/Query/RelationalQueryTranslationPostprocessor.cs +++ b/src/EFCore.Relational/Query/RelationalQueryTranslationPostprocessor.cs @@ -16,7 +16,7 @@ public RelationalQueryTranslationPostprocessor( [NotNull] QueryTranslationPostprocessorDependencies dependencies, [NotNull] RelationalQueryTranslationPostprocessorDependencies relationalDependencies, [NotNull] QueryCompilationContext queryCompilationContext) - : base(dependencies) + : base(dependencies, queryCompilationContext) { Check.NotNull(relationalDependencies, nameof(relationalDependencies)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); diff --git a/src/EFCore.Relational/Query/RelationalQueryTranslationPreprocessor.cs b/src/EFCore.Relational/Query/RelationalQueryTranslationPreprocessor.cs index 35f5a4bec1f..a026b076218 100644 --- a/src/EFCore.Relational/Query/RelationalQueryTranslationPreprocessor.cs +++ b/src/EFCore.Relational/Query/RelationalQueryTranslationPreprocessor.cs @@ -23,9 +23,9 @@ public RelationalQueryTranslationPreprocessor( protected virtual RelationalQueryTranslationPreprocessorDependencies RelationalDependencies { get; } - public override Expression NormalizeQueryableMethodCall(Expression expression) + public override Expression NormalizeQueryableMethod(Expression expression) { - expression = base.NormalizeQueryableMethodCall(expression); + expression = base.NormalizeQueryableMethod(expression); expression = new QueryableFunctionToQueryRootConvertingExpressionVisitor(QueryCompilationContext.Model).Visit(expression); return expression; diff --git a/src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs index 509d3291960..b9b4018b850 100644 --- a/src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs @@ -30,7 +30,7 @@ public RelationalQueryableMethodTranslatingExpressionVisitor( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies, [NotNull] RelationalQueryableMethodTranslatingExpressionVisitorDependencies relationalDependencies, [NotNull] QueryCompilationContext queryCompilationContext) - : base(dependencies, subquery: false) + : base(dependencies, queryCompilationContext, subquery: false) { Check.NotNull(dependencies, nameof(dependencies)); Check.NotNull(relationalDependencies, nameof(relationalDependencies)); @@ -51,7 +51,7 @@ public RelationalQueryableMethodTranslatingExpressionVisitor( protected RelationalQueryableMethodTranslatingExpressionVisitor( [NotNull] RelationalQueryableMethodTranslatingExpressionVisitor parentVisitor) - : base(parentVisitor.Dependencies, subquery: true) + : base(parentVisitor.Dependencies, parentVisitor.QueryCompilationContext, subquery: true) { RelationalDependencies = parentVisitor.RelationalDependencies; _queryCompilationContext = parentVisitor._queryCompilationContext; diff --git a/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs index 26c7e9b9991..bbe57eee56c 100644 --- a/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.Relational/Query/RelationalShapedQueryCompilingExpressionVisitor.cs @@ -69,10 +69,10 @@ protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQuery dataReaderParameter, isNonComposedFromSql ? indexMapParameter : null, _detailedErrorsEnabled, - IsBuffering) + QueryCompilationContext.IsBuffering) .Visit(shaper, out var projectionColumns); - shaper = new CustomShaperCompilingExpressionVisitor(dataReaderParameter, resultCoordinatorParameter, IsTracking) + shaper = new CustomShaperCompilingExpressionVisitor(dataReaderParameter, resultCoordinatorParameter, QueryCompilationContext.IsTracking) .Visit(shaper); IReadOnlyList columnNames = null; diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMemberTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMemberTranslator.cs index ad7ff9f6630..b91003c23b2 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMemberTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMemberTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerGeometryCollectionMemberTranslator : IMemberTranslator { private static readonly MemberInfo _count = typeof(GeometryCollection).GetRuntimeProperty(nameof(GeometryCollection.Count)); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerGeometryCollectionMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMethodTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMethodTranslator.cs index 92effc83d5d..82bc3f42d3b 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMethodTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryCollectionMethodTranslator.cs @@ -12,12 +12,24 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerGeometryCollectionMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _item = typeof(GeometryCollection).GetRuntimeProperty("Item").GetMethod; private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerGeometryCollectionMethodTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -26,6 +38,12 @@ public SqlServerGeometryCollectionMethodTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMemberTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMemberTranslator.cs index aa97b308e4e..b945911775e 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMemberTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMemberTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerGeometryMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName = new Dictionary @@ -43,6 +49,12 @@ public class SqlServerGeometryMemberTranslator : IMemberTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerGeometryMemberTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -51,6 +63,12 @@ public SqlServerGeometryMemberTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMethodTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMethodTranslator.cs index 0534d7b9eb3..2d10a10d77c 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMethodTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerGeometryMethodTranslator.cs @@ -14,6 +14,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerGeometryMethodTranslator : IMethodCallTranslator { private static readonly IDictionary _methodToFunctionName = new Dictionary @@ -53,6 +59,12 @@ public class SqlServerGeometryMethodTranslator : IMethodCallTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerGeometryMethodTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -61,6 +73,12 @@ public SqlServerGeometryMethodTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMemberTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMemberTranslator.cs index 9baae114288..903fc859c6f 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMemberTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMemberTranslator.cs @@ -14,6 +14,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerLineStringMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName = new Dictionary @@ -28,6 +34,12 @@ public class SqlServerLineStringMemberTranslator : IMemberTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerLineStringMemberTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -36,6 +48,12 @@ public SqlServerLineStringMemberTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMethodTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMethodTranslator.cs index 5df3e4dc453..2ca69cc981c 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMethodTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerLineStringMethodTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerLineStringMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _getPointN = typeof(LineString).GetRuntimeMethod( @@ -20,6 +26,12 @@ public class SqlServerLineStringMethodTranslator : IMethodCallTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerLineStringMethodTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -28,6 +40,12 @@ public SqlServerLineStringMethodTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerMultiLineStringMemberTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerMultiLineStringMemberTranslator.cs index c98f6323116..64a5be87e89 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerMultiLineStringMemberTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerMultiLineStringMemberTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerMultiLineStringMemberTranslator : IMemberTranslator { private static readonly MemberInfo _isClosed = typeof(MultiLineString).GetRuntimeProperty(nameof(MultiLineString.IsClosed)); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerMultiLineStringMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMemberTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMemberTranslator.cs index 2d2c8aec4ae..a1329465ca9 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMemberTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMemberTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerPolygonMemberTranslator : IMemberTranslator { private static readonly MemberInfo _exteriorRing = typeof(Polygon).GetRuntimeProperty(nameof(Polygon.ExteriorRing)); @@ -26,6 +32,12 @@ public class SqlServerPolygonMemberTranslator : IMemberTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerPolygonMemberTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -34,6 +46,12 @@ public SqlServerPolygonMemberTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMethodTranslator.cs b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMethodTranslator.cs index 0b5599056ff..d516e602d15 100644 --- a/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMethodTranslator.cs +++ b/src/EFCore.SqlServer.NTS/Query/Internal/SqlServerPolygonMethodTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerPolygonMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _getInteriorRingN = typeof(Polygon).GetRuntimeMethod( @@ -21,6 +27,12 @@ public class SqlServerPolygonMethodTranslator : IMethodCallTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerPolygonMethodTranslator( [NotNull] IRelationalTypeMappingSource typeMappingSource, [NotNull] ISqlExpressionFactory sqlExpressionFactory) @@ -29,6 +41,12 @@ public SqlServerPolygonMethodTranslator( _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Metadata/Conventions/SqlServerStoreGenerationConvention.cs b/src/EFCore.SqlServer/Metadata/Conventions/SqlServerStoreGenerationConvention.cs index 9e3d7c918e9..746c69f458e 100644 --- a/src/EFCore.SqlServer/Metadata/Conventions/SqlServerStoreGenerationConvention.cs +++ b/src/EFCore.SqlServer/Metadata/Conventions/SqlServerStoreGenerationConvention.cs @@ -96,6 +96,7 @@ public override void ProcessPropertyAnnotationChanged( base.ProcessPropertyAnnotationChanged(propertyBuilder, name, annotation, oldAnnotation, context); } + /// protected override void Validate(IConventionProperty property) { if (property.GetValueGenerationStrategyConfigurationSource() != null diff --git a/src/EFCore.SqlServer/Query/Internal/SearchConditionConvertingExpressionVisitor.cs b/src/EFCore.SqlServer/Query/Internal/SearchConditionConvertingExpressionVisitor.cs index 7df5a435198..718eae0ae45 100644 --- a/src/EFCore.SqlServer/Query/Internal/SearchConditionConvertingExpressionVisitor.cs +++ b/src/EFCore.SqlServer/Query/Internal/SearchConditionConvertingExpressionVisitor.cs @@ -13,11 +13,23 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SearchConditionConvertingExpressionVisitor : SqlExpressionVisitor { private bool _isSearchCondition; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SearchConditionConvertingExpressionVisitor( [NotNull] ISqlExpressionFactory sqlExpressionFactory) { @@ -76,6 +88,12 @@ private SqlExpression SimplifyNegatedBinary(SqlExpression sqlExpression) sqlBinaryOperand.TypeMapping) : sqlExpression; + /// + /// 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. + /// protected override Expression VisitCase(CaseExpression caseExpression) { Check.NotNull(caseExpression, nameof(caseExpression)); @@ -103,6 +121,12 @@ protected override Expression VisitCase(CaseExpression caseExpression) return ApplyConversion(caseExpression.Update(operand, whenClauses, elseResult), condition: false); } + /// + /// 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. + /// protected override Expression VisitColumn(ColumnExpression columnExpression) { Check.NotNull(columnExpression, nameof(columnExpression)); @@ -110,6 +134,12 @@ protected override Expression VisitColumn(ColumnExpression columnExpression) return ApplyConversion(columnExpression, condition: false); } + /// + /// 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. + /// protected override Expression VisitExists(ExistsExpression existsExpression) { Check.NotNull(existsExpression, nameof(existsExpression)); @@ -122,6 +152,12 @@ protected override Expression VisitExists(ExistsExpression existsExpression) return ApplyConversion(existsExpression.Update(subquery), condition: true); } + /// + /// 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. + /// protected override Expression VisitFromSql(FromSqlExpression fromSqlExpression) { Check.NotNull(fromSqlExpression, nameof(fromSqlExpression)); @@ -129,6 +165,12 @@ protected override Expression VisitFromSql(FromSqlExpression fromSqlExpression) return fromSqlExpression; } + /// + /// 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. + /// protected override Expression VisitIn(InExpression inExpression) { Check.NotNull(inExpression, nameof(inExpression)); @@ -144,6 +186,12 @@ protected override Expression VisitIn(InExpression inExpression) return ApplyConversion(inExpression.Update(item, values, subquery), condition: true); } + /// + /// 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. + /// protected override Expression VisitLike(LikeExpression likeExpression) { Check.NotNull(likeExpression, nameof(likeExpression)); @@ -158,6 +206,12 @@ protected override Expression VisitLike(LikeExpression likeExpression) return ApplyConversion(likeExpression.Update(match, pattern, escapeChar), condition: true); } + /// + /// 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. + /// protected override Expression VisitSelect(SelectExpression selectExpression) { Check.NotNull(selectExpression, nameof(selectExpression)); @@ -223,6 +277,12 @@ protected override Expression VisitSelect(SelectExpression selectExpression) : selectExpression; } + /// + /// 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. + /// protected override Expression VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression) { Check.NotNull(sqlBinaryExpression, nameof(sqlBinaryExpression)); @@ -259,6 +319,12 @@ protected override Expression VisitSqlBinary(SqlBinaryExpression sqlBinaryExpres return ApplyConversion(sqlBinaryExpression, condition); } + /// + /// 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. + /// protected override Expression VisitSqlUnary(SqlUnaryExpression sqlUnaryExpression) { Check.NotNull(sqlUnaryExpression, nameof(sqlUnaryExpression)); @@ -306,6 +372,12 @@ when sqlUnaryExpression.IsLogicalNot(): condition: resultCondition)); } + /// + /// 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. + /// protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstantExpression) { Check.NotNull(sqlConstantExpression, nameof(sqlConstantExpression)); @@ -313,6 +385,12 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant return ApplyConversion(sqlConstantExpression, condition: false); } + /// + /// 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. + /// protected override Expression VisitSqlFragment(SqlFragmentExpression sqlFragmentExpression) { Check.NotNull(sqlFragmentExpression, nameof(sqlFragmentExpression)); @@ -320,6 +398,12 @@ protected override Expression VisitSqlFragment(SqlFragmentExpression sqlFragment return sqlFragmentExpression; } + /// + /// 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. + /// protected override Expression VisitSqlFunction(SqlFunctionExpression sqlFunctionExpression) { Check.NotNull(sqlFunctionExpression, nameof(sqlFunctionExpression)); @@ -342,6 +426,12 @@ protected override Expression VisitSqlFunction(SqlFunctionExpression sqlFunction return ApplyConversion(newFunction, condition); } + /// + /// 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. + /// protected override Expression VisitQueryableFunction(QueryableFunctionExpression queryableFunctionExpression) { Check.NotNull(queryableFunctionExpression, nameof(queryableFunctionExpression)); @@ -350,6 +440,12 @@ protected override Expression VisitQueryableFunction(QueryableFunctionExpression return queryableFunctionExpression; } + /// + /// 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. + /// protected override Expression VisitSqlParameter(SqlParameterExpression sqlParameterExpression) { Check.NotNull(sqlParameterExpression, nameof(sqlParameterExpression)); @@ -357,6 +453,12 @@ protected override Expression VisitSqlParameter(SqlParameterExpression sqlParame return ApplyConversion(sqlParameterExpression, condition: false); } + /// + /// 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. + /// protected override Expression VisitTable(TableExpression tableExpression) { Check.NotNull(tableExpression, nameof(tableExpression)); @@ -364,6 +466,12 @@ protected override Expression VisitTable(TableExpression tableExpression) return tableExpression; } + /// + /// 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. + /// protected override Expression VisitProjection(ProjectionExpression projectionExpression) { Check.NotNull(projectionExpression, nameof(projectionExpression)); @@ -373,6 +481,12 @@ protected override Expression VisitProjection(ProjectionExpression projectionExp return projectionExpression.Update(expression); } + /// + /// 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. + /// protected override Expression VisitOrdering(OrderingExpression orderingExpression) { Check.NotNull(orderingExpression, nameof(orderingExpression)); @@ -382,6 +496,12 @@ protected override Expression VisitOrdering(OrderingExpression orderingExpressio return orderingExpression.Update(expression); } + /// + /// 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. + /// protected override Expression VisitCrossJoin(CrossJoinExpression crossJoinExpression) { Check.NotNull(crossJoinExpression, nameof(crossJoinExpression)); @@ -394,6 +514,12 @@ protected override Expression VisitCrossJoin(CrossJoinExpression crossJoinExpres return crossJoinExpression.Update(table); } + /// + /// 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. + /// protected override Expression VisitCrossApply(CrossApplyExpression crossApplyExpression) { Check.NotNull(crossApplyExpression, nameof(crossApplyExpression)); @@ -406,6 +532,12 @@ protected override Expression VisitCrossApply(CrossApplyExpression crossApplyExp return crossApplyExpression.Update(table); } + /// + /// 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. + /// protected override Expression VisitOuterApply(OuterApplyExpression outerApplyExpression) { Check.NotNull(outerApplyExpression, nameof(outerApplyExpression)); @@ -418,6 +550,12 @@ protected override Expression VisitOuterApply(OuterApplyExpression outerApplyExp return outerApplyExpression.Update(table); } + /// + /// 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. + /// protected override Expression VisitInnerJoin(InnerJoinExpression innerJoinExpression) { Check.NotNull(innerJoinExpression, nameof(innerJoinExpression)); @@ -432,6 +570,12 @@ protected override Expression VisitInnerJoin(InnerJoinExpression innerJoinExpres return innerJoinExpression.Update(table, joinPredicate); } + /// + /// 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. + /// protected override Expression VisitLeftJoin(LeftJoinExpression leftJoinExpression) { Check.NotNull(leftJoinExpression, nameof(leftJoinExpression)); @@ -446,6 +590,12 @@ protected override Expression VisitLeftJoin(LeftJoinExpression leftJoinExpressio return leftJoinExpression.Update(table, joinPredicate); } + /// + /// 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. + /// protected override Expression VisitScalarSubquery(ScalarSubqueryExpression scalarSubqueryExpression) { Check.NotNull(scalarSubqueryExpression, nameof(scalarSubqueryExpression)); @@ -457,6 +607,12 @@ protected override Expression VisitScalarSubquery(ScalarSubqueryExpression scala return ApplyConversion(scalarSubqueryExpression.Update(subquery), condition: false); } + /// + /// 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. + /// protected override Expression VisitRowNumber(RowNumberExpression rowNumberExpression) { Check.NotNull(rowNumberExpression, nameof(rowNumberExpression)); @@ -485,6 +641,12 @@ protected override Expression VisitRowNumber(RowNumberExpression rowNumberExpres return ApplyConversion(rowNumberExpression.Update(partitions, orderings), condition: false); } + /// + /// 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. + /// protected override Expression VisitExcept(ExceptExpression exceptExpression) { Check.NotNull(exceptExpression, nameof(exceptExpression)); @@ -498,6 +660,12 @@ protected override Expression VisitExcept(ExceptExpression exceptExpression) return exceptExpression.Update(source1, source2); } + /// + /// 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. + /// protected override Expression VisitIntersect(IntersectExpression intersectExpression) { Check.NotNull(intersectExpression, nameof(intersectExpression)); @@ -511,6 +679,12 @@ protected override Expression VisitIntersect(IntersectExpression intersectExpres return intersectExpression.Update(source1, source2); } + /// + /// 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. + /// protected override Expression VisitUnion(UnionExpression unionExpression) { Check.NotNull(unionExpression, nameof(unionExpression)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerByteArrayMethodTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerByteArrayMethodTranslator.cs index 438a696c58d..93fe4c79598 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerByteArrayMethodTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerByteArrayMethodTranslator.cs @@ -10,15 +10,33 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerByteArrayMethodTranslator : IMethodCallTranslator { private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerByteArrayMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerConvertTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerConvertTranslator.cs index 714caba79b2..482b4feffdf 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerConvertTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerConvertTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerConvertTranslator : IMethodCallTranslator { private static readonly Dictionary _typeMapping = new Dictionary @@ -48,11 +54,23 @@ private static readonly IEnumerable _supportedMethods private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerConvertTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerDataLengthFunctionTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerDataLengthFunctionTranslator.cs index 7915666a7e5..44f50585aaf 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerDataLengthFunctionTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerDataLengthFunctionTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerDataLengthFunctionTranslator : IMethodCallTranslator { private static readonly List _longReturningTypes = new List { "nvarchar(max)", "varchar(max)", "varbinary(max)" }; @@ -58,11 +64,23 @@ private static readonly HashSet _methodInfoDataLengthMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerDataLengthFunctionTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerDateDiffFunctionsTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerDateDiffFunctionsTranslator.cs index 961619a7dd0..6f0aafd6b78 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerDateDiffFunctionsTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerDateDiffFunctionsTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerDateDiffFunctionsTranslator : IMethodCallTranslator { private readonly Dictionary _methodInfoDateDiffMapping @@ -332,12 +338,24 @@ private readonly Dictionary _methodInfoDateDiffMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerDateDiffFunctionsTranslator( [NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMemberTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMemberTranslator.cs index aae79c66f76..97218f35f02 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMemberTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMemberTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerDateTimeMemberTranslator : IMemberTranslator { private static readonly Dictionary _datePartMapping @@ -28,11 +34,23 @@ private static readonly Dictionary _datePartMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerDateTimeMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs index 5f4d695efc7..6358b006004 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerDateTimeMethodTranslator : IMethodCallTranslator { private readonly Dictionary _methodInfoDatePartMapping = new Dictionary @@ -33,11 +39,23 @@ public class SqlServerDateTimeMethodTranslator : IMethodCallTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerDateTimeMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerFromPartsFunctionTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerFromPartsFunctionTranslator.cs index 0d5cd0cc73b..1a9fda7dd5a 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerFromPartsFunctionTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerFromPartsFunctionTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerFromPartsFunctionTranslator : IMethodCallTranslator { private static readonly MethodInfo _dateFromPartsMethodInfo = typeof(SqlServerDbFunctionsExtensions) @@ -54,6 +60,12 @@ public class SqlServerFromPartsFunctionTranslator : IMethodCallTranslator private readonly IRelationalTypeMappingSource _typeMappingSource; + /// + /// 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 SqlServerFromPartsFunctionTranslator( [NotNull] ISqlExpressionFactory sqlExpressionFactory, [NotNull] IRelationalTypeMappingSource typeMappingSource) @@ -62,6 +74,12 @@ public SqlServerFromPartsFunctionTranslator( _typeMappingSource = typeMappingSource; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { if (_methodFunctionMapping.TryGetValue(method, out var value)) diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerFullTextSearchFunctionsTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerFullTextSearchFunctionsTranslator.cs index 78971f993b9..b6f165c2861 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerFullTextSearchFunctionsTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerFullTextSearchFunctionsTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerFullTextSearchFunctionsTranslator : IMethodCallTranslator { private const string FreeTextFunctionName = "FREETEXT"; @@ -49,11 +55,23 @@ private static readonly IDictionary _functionMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerFullTextSearchFunctionsTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerIsDateFunctionTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerIsDateFunctionTranslator.cs index 030c149592a..40937ed0cde 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerIsDateFunctionTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerIsDateFunctionTranslator.cs @@ -10,6 +10,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerIsDateFunctionTranslator : IMethodCallTranslator { private readonly ISqlExpressionFactory _sqlExpressionFactory; @@ -17,9 +23,21 @@ public class SqlServerIsDateFunctionTranslator : IMethodCallTranslator private static readonly MethodInfo _methodInfo = typeof(SqlServerDbFunctionsExtensions) .GetRuntimeMethod(nameof(SqlServerDbFunctionsExtensions.IsDate), new[] { typeof(DbFunctions), typeof(string) }); + /// + /// 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 SqlServerIsDateFunctionTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) => _sqlExpressionFactory = sqlExpressionFactory; + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerMathTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerMathTranslator.cs index 607edc57cef..f19fea2046b 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerMathTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerMathTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerMathTranslator : IMethodCallTranslator { private static readonly Dictionary _supportedMethodTranslations = new Dictionary @@ -65,11 +71,23 @@ public class SqlServerMathTranslator : IMethodCallTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerMathTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerMemberTranslatorProvider.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerMemberTranslatorProvider.cs index 4004877da20..9916a781f3e 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerMemberTranslatorProvider.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerMemberTranslatorProvider.cs @@ -6,8 +6,20 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerMemberTranslatorProvider : RelationalMemberTranslatorProvider { + /// + /// 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 SqlServerMemberTranslatorProvider([NotNull] RelationalMemberTranslatorProviderDependencies dependencies) : base(dependencies) { diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerMethodCallTranslatorProvider.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerMethodCallTranslatorProvider.cs index 332d03b6125..c94e2f3a76e 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerMethodCallTranslatorProvider.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerMethodCallTranslatorProvider.cs @@ -6,8 +6,20 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerMethodCallTranslatorProvider : RelationalMethodCallTranslatorProvider { + /// + /// 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 SqlServerMethodCallTranslatorProvider([NotNull] RelationalMethodCallTranslatorProviderDependencies dependencies) : base(dependencies) { diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerNewGuidTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerNewGuidTranslator.cs index 314fbe88a50..f99ed6f9509 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerNewGuidTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerNewGuidTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerNewGuidTranslator : IMethodCallTranslator { private static readonly MethodInfo _methodInfo = typeof(Guid).GetRuntimeMethod(nameof(Guid.NewGuid), Array.Empty()); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerNewGuidTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerObjectToStringTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerObjectToStringTranslator.cs index 1f0617bb982..805972f0455 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerObjectToStringTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerObjectToStringTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerObjectToStringTranslator : IMethodCallTranslator { private const int DefaultLength = 100; @@ -39,11 +45,23 @@ private static readonly Dictionary _typeMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerObjectToStringTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessor.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessor.cs index 6f2f58771be..379db6eb29c 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessor.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessor.cs @@ -9,8 +9,20 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerParameterBasedQueryTranslationPostprocessor : RelationalParameterBasedQueryTranslationPostprocessor { + /// + /// 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 SqlServerParameterBasedQueryTranslationPostprocessor( [NotNull] RelationalParameterBasedQueryTranslationPostprocessorDependencies dependencies, bool useRelationalNulls) @@ -18,6 +30,12 @@ public SqlServerParameterBasedQueryTranslationPostprocessor( { } + /// + /// 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 override (SelectExpression, bool) Optimize( SelectExpression selectExpression, IReadOnlyDictionary parametersValues) diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessorFactory.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessorFactory.cs index 5631d625d11..93e33bd4f0f 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessorFactory.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerParameterBasedQueryTranslationPostprocessorFactory.cs @@ -6,16 +6,34 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerParameterBasedQueryTranslationPostprocessorFactory : IRelationalParameterBasedQueryTranslationPostprocessorFactory { private readonly RelationalParameterBasedQueryTranslationPostprocessorDependencies _dependencies; + /// + /// 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 SqlServerParameterBasedQueryTranslationPostprocessorFactory( [NotNull] RelationalParameterBasedQueryTranslationPostprocessorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual RelationalParameterBasedQueryTranslationPostprocessor Create(bool useRelationalNulls) => new SqlServerParameterBasedQueryTranslationPostprocessor(_dependencies, useRelationalNulls); } diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs index 71a13e10acc..c12d794fef9 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs @@ -9,13 +9,31 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerQuerySqlGenerator : QuerySqlGenerator { + /// + /// 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 SqlServerQuerySqlGenerator([NotNull] QuerySqlGeneratorDependencies dependencies) : base(dependencies) { } + /// + /// 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. + /// protected override void GenerateTop(SelectExpression selectExpression) { Check.NotNull(selectExpression, nameof(selectExpression)); @@ -31,6 +49,12 @@ protected override void GenerateTop(SelectExpression selectExpression) } } + /// + /// 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. + /// protected override void GenerateLimitOffset(SelectExpression selectExpression) { Check.NotNull(selectExpression, nameof(selectExpression)); @@ -56,6 +80,12 @@ protected override void GenerateLimitOffset(SelectExpression selectExpression) } } + /// + /// 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. + /// protected override Expression VisitSqlFunction(SqlFunctionExpression sqlFunctionExpression) { Check.NotNull(sqlFunctionExpression, nameof(sqlFunctionExpression)); @@ -76,6 +106,12 @@ protected override Expression VisitSqlFunction(SqlFunctionExpression sqlFunction return base.VisitSqlFunction(sqlFunctionExpression); } + /// + /// 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. + /// protected override Expression VisitQueryableFunction(QueryableFunctionExpression queryableFunctionExpression) { Check.NotNull(queryableFunctionExpression, nameof(queryableFunctionExpression)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGeneratorFactory.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGeneratorFactory.cs index 0fc4d1c289e..4e00a89a539 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGeneratorFactory.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGeneratorFactory.cs @@ -6,15 +6,33 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerQuerySqlGeneratorFactory : IQuerySqlGeneratorFactory { private readonly QuerySqlGeneratorDependencies _dependencies; + /// + /// 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 SqlServerQuerySqlGeneratorFactory([NotNull] QuerySqlGeneratorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QuerySqlGenerator Create() => new SqlServerQuerySqlGenerator(_dependencies); } diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs index 0a7f3dae808..643eadc10ac 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitor.cs @@ -10,6 +10,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerSqlTranslatingExpressionVisitor : RelationalSqlTranslatingExpressionVisitor { private static readonly HashSet _dateTimeDataTypes @@ -32,6 +38,12 @@ private static readonly HashSet _arithmeticOperatorTypes ExpressionType.Modulo }; + /// + /// 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 SqlServerSqlTranslatingExpressionVisitor( [NotNull] RelationalSqlTranslatingExpressionVisitorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext, @@ -40,6 +52,12 @@ public SqlServerSqlTranslatingExpressionVisitor( { } + /// + /// 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. + /// protected override Expression VisitBinary(BinaryExpression binaryExpression) { Check.NotNull(binaryExpression, nameof(binaryExpression)); @@ -54,6 +72,12 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression) : visitedExpression); } + /// + /// 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. + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { if (unaryExpression.NodeType == ExpressionType.ArrayLength @@ -80,6 +104,12 @@ protected override Expression VisitUnary(UnaryExpression unaryExpression) return base.VisitUnary(unaryExpression); } + /// + /// 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 override SqlExpression TranslateLongCount(Expression expression = null) { if (expression != null) diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitorFactory.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitorFactory.cs index 46b501e2e48..db4d67b89a6 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerSqlTranslatingExpressionVisitorFactory.cs @@ -6,16 +6,34 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerSqlTranslatingExpressionVisitorFactory : IRelationalSqlTranslatingExpressionVisitorFactory { private readonly RelationalSqlTranslatingExpressionVisitorDependencies _dependencies; + /// + /// 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 SqlServerSqlTranslatingExpressionVisitorFactory( [NotNull] RelationalSqlTranslatingExpressionVisitorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual RelationalSqlTranslatingExpressionVisitor Create( QueryCompilationContext queryCompilationContext, QueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor) diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerStringMemberTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerStringMemberTranslator.cs index 05b55e1a4ec..81fb5d99401 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerStringMemberTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerStringMemberTranslator.cs @@ -10,15 +10,33 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerStringMemberTranslator : IMemberTranslator { private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerStringMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerStringMethodTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerStringMethodTranslator.cs index 291b0f446df..3de202e177f 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerStringMethodTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerStringMethodTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerStringMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _indexOfMethodInfo @@ -66,11 +72,23 @@ private static readonly MethodInfo _endsWithMethodInfo private const char LikeEscapeChar = '\\'; + /// + /// 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 SqlServerStringMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerTimeSpanMemberTranslator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerTimeSpanMemberTranslator.cs index 12df9c927bd..23b24c9de35 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerTimeSpanMemberTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerTimeSpanMemberTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Query.Internal { + /// + /// 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 class SqlServerTimeSpanMemberTranslator : IMemberTranslator { private static readonly Dictionary _datePartMappings = new Dictionary @@ -23,11 +29,23 @@ public class SqlServerTimeSpanMemberTranslator : IMemberTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlServerTimeSpanMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs index 5903bc8b8f4..2a392b69bda 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs @@ -362,6 +362,13 @@ private RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingIn private static readonly List _nameBasesUsingPrecision = new List() { "decimal", "dec", "numeric", "datetime2", "datetimeoffset" }; + + /// + /// 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. + /// protected override bool StoreTypeNameBaseUsesPrecision(string storeTypeNameBase) => _nameBasesUsingPrecision.Contains(storeTypeNameBase); } diff --git a/src/EFCore.Sqlite.Core/Internal/SqliteModelValidator.cs b/src/EFCore.Sqlite.Core/Internal/SqliteModelValidator.cs index 5e53564852c..fcdf62433e0 100644 --- a/src/EFCore.Sqlite.Core/Internal/SqliteModelValidator.cs +++ b/src/EFCore.Sqlite.Core/Internal/SqliteModelValidator.cs @@ -83,6 +83,12 @@ protected virtual void ValidateNoSequences( } } + /// + /// 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. + /// protected override void ValidateCompatible(IProperty property, IProperty duplicateProperty, string columnName, string tableName) { base.ValidateCompatible(property, duplicateProperty, columnName, tableName); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteByteArrayMethodTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteByteArrayMethodTranslator.cs index aa160ee6032..93ab19b3e86 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteByteArrayMethodTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteByteArrayMethodTranslator.cs @@ -9,15 +9,33 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteByteArrayMethodTranslator : IMethodCallTranslator { private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteByteArrayMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { if (method.IsGenericMethod diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs index ebf2dacf9f6..44bc84da709 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteDateTimeAddTranslator : IMethodCallTranslator { private static readonly MethodInfo _addMilliseconds @@ -31,11 +37,23 @@ private static readonly MethodInfo _addTicks private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteDateTimeAddTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeMemberTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeMemberTranslator.cs index 59b3d205768..ee955d59d24 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeMemberTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeMemberTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteDateTimeMemberTranslator : IMemberTranslator { private static readonly Dictionary _datePartMapping @@ -28,11 +34,23 @@ private static readonly Dictionary _datePartMapping private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteDateTimeMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMathTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMathTranslator.cs index bedd1e060be..ee531b7e2a0 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMathTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMathTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteMathTranslator : IMethodCallTranslator { private static readonly Dictionary _supportedMethods = new Dictionary @@ -47,11 +53,23 @@ public class SqliteMathTranslator : IMethodCallTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteMathTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMemberTranslatorProvider.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMemberTranslatorProvider.cs index b73b352f31f..c156bf44752 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMemberTranslatorProvider.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMemberTranslatorProvider.cs @@ -6,8 +6,20 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteMemberTranslatorProvider : RelationalMemberTranslatorProvider { + /// + /// 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 SqliteMemberTranslatorProvider([NotNull] RelationalMemberTranslatorProviderDependencies dependencies) : base(dependencies) { diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMethodCallTranslatorProvider.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMethodCallTranslatorProvider.cs index f3c8d14fd9d..dca218e62a6 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteMethodCallTranslatorProvider.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteMethodCallTranslatorProvider.cs @@ -6,8 +6,20 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteMethodCallTranslatorProvider : RelationalMethodCallTranslatorProvider { + /// + /// 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 SqliteMethodCallTranslatorProvider([NotNull] RelationalMethodCallTranslatorProviderDependencies dependencies) : base(dependencies) { diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGenerator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGenerator.cs index cf1ce72e58d..4a1b3e0e4f9 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGenerator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGenerator.cs @@ -9,13 +9,31 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteQuerySqlGenerator : QuerySqlGenerator { + /// + /// 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 SqliteQuerySqlGenerator([NotNull] QuerySqlGeneratorDependencies dependencies) : base(dependencies) { } + /// + /// 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. + /// protected override string GenerateOperator(SqlBinaryExpression binaryExpression) { Check.NotNull(binaryExpression, nameof(binaryExpression)); @@ -26,6 +44,12 @@ protected override string GenerateOperator(SqlBinaryExpression binaryExpression) : base.GenerateOperator(binaryExpression); } + /// + /// 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. + /// protected override void GenerateLimitOffset(SelectExpression selectExpression) { Check.NotNull(selectExpression, nameof(selectExpression)); @@ -49,6 +73,12 @@ protected override void GenerateLimitOffset(SelectExpression selectExpression) } } + /// + /// 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. + /// protected override void GenerateSetOperationOperand(SetOperationBase setOperation, SelectExpression operand) { Check.NotNull(setOperation, nameof(setOperation)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGeneratorFactory.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGeneratorFactory.cs index 90fd840f52a..37ff3cc5589 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGeneratorFactory.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQuerySqlGeneratorFactory.cs @@ -6,15 +6,33 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteQuerySqlGeneratorFactory : IQuerySqlGeneratorFactory { private readonly QuerySqlGeneratorDependencies _dependencies; + /// + /// 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 SqliteQuerySqlGeneratorFactory([NotNull] QuerySqlGeneratorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QuerySqlGenerator Create() => new SqliteQuerySqlGenerator(_dependencies); } diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitor.cs index f2bd174b4b2..ba9e5691438 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitor.cs @@ -13,8 +13,20 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteQueryableMethodTranslatingExpressionVisitor : RelationalQueryableMethodTranslatingExpressionVisitor { + /// + /// 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 SqliteQueryableMethodTranslatingExpressionVisitor( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies, [NotNull] RelationalQueryableMethodTranslatingExpressionVisitorDependencies relationalDependencies, @@ -23,15 +35,33 @@ public SqliteQueryableMethodTranslatingExpressionVisitor( { } + /// + /// 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. + /// protected SqliteQueryableMethodTranslatingExpressionVisitor( [NotNull] SqliteQueryableMethodTranslatingExpressionVisitor parentVisitor) : base(parentVisitor) { } + /// + /// 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. + /// protected override QueryableMethodTranslatingExpressionVisitor CreateSubqueryVisitor() => new SqliteQueryableMethodTranslatingExpressionVisitor(this); + /// + /// 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. + /// protected override ShapedQueryExpression TranslateOrderBy( ShapedQueryExpression source, LambdaExpression keySelector, bool ascending) { @@ -58,6 +88,12 @@ protected override ShapedQueryExpression TranslateOrderBy( return translation; } + /// + /// 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. + /// protected override ShapedQueryExpression TranslateThenBy(ShapedQueryExpression source, LambdaExpression keySelector, bool ascending) { Check.NotNull(source, nameof(source)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitorFactory.cs index 4ff06357257..bbc45123546 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -7,11 +7,23 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteQueryableMethodTranslatingExpressionVisitorFactory : IQueryableMethodTranslatingExpressionVisitorFactory { private readonly QueryableMethodTranslatingExpressionVisitorDependencies _dependencies; private readonly RelationalQueryableMethodTranslatingExpressionVisitorDependencies _relationalDependencies; + /// + /// 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 SqliteQueryableMethodTranslatingExpressionVisitorFactory( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies, [NotNull] RelationalQueryableMethodTranslatingExpressionVisitorDependencies relationalDependencies) @@ -20,6 +32,12 @@ public SqliteQueryableMethodTranslatingExpressionVisitorFactory( _relationalDependencies = relationalDependencies; } + /// + /// 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 virtual QueryableMethodTranslatingExpressionVisitor Create(QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs index ae559a9f363..85ff339fe2e 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteSqlTranslatingExpressionVisitor : RelationalSqlTranslatingExpressionVisitor { private static readonly IReadOnlyDictionary> _restrictedBinaryExpressions @@ -77,6 +83,12 @@ private static readonly IReadOnlyDictionary + /// 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 SqliteSqlTranslatingExpressionVisitor( [NotNull] RelationalSqlTranslatingExpressionVisitorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext, @@ -85,6 +97,12 @@ public SqliteSqlTranslatingExpressionVisitor( { } + /// + /// 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. + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { Check.NotNull(unaryExpression, nameof(unaryExpression)); @@ -122,6 +140,12 @@ protected override Expression VisitUnary(UnaryExpression unaryExpression) return visitedExpression; } + /// + /// 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. + /// protected override Expression VisitBinary(BinaryExpression binaryExpression) { Check.NotNull(binaryExpression, nameof(binaryExpression)); @@ -162,6 +186,12 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression) return visitedExpression; } + /// + /// 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 override SqlExpression TranslateAverage(Expression expression) { Check.NotNull(expression, nameof(expression)); @@ -175,6 +205,12 @@ public override SqlExpression TranslateAverage(Expression expression) return visitedExpression; } + /// + /// 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 override SqlExpression TranslateMax(Expression expression) { Check.NotNull(expression, nameof(expression)); @@ -192,6 +228,18 @@ public override SqlExpression TranslateMax(Expression expression) return visitedExpression; } + /// + /// 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. + /// + /// + /// 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 override SqlExpression TranslateMin(Expression expression) { Check.NotNull(expression, nameof(expression)); @@ -209,6 +257,12 @@ public override SqlExpression TranslateMin(Expression expression) return visitedExpression; } + /// + /// 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 override SqlExpression TranslateSum(Expression expression) { Check.NotNull(expression, nameof(expression)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitorFactory.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitorFactory.cs index cfcec69607c..c314d1b570d 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitorFactory.cs @@ -6,16 +6,34 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteSqlTranslatingExpressionVisitorFactory : IRelationalSqlTranslatingExpressionVisitorFactory { private readonly RelationalSqlTranslatingExpressionVisitorDependencies _dependencies; + /// + /// 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 SqliteSqlTranslatingExpressionVisitorFactory( [NotNull] RelationalSqlTranslatingExpressionVisitorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual RelationalSqlTranslatingExpressionVisitor Create( QueryCompilationContext queryCompilationContext, QueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor) diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringLengthTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringLengthTranslator.cs index 4203a34adf1..db694f386ce 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringLengthTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringLengthTranslator.cs @@ -10,15 +10,33 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteStringLengthTranslator : IMemberTranslator { private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteStringLengthTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringMethodTranslator.cs b/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringMethodTranslator.cs index 47fb1fd9156..8820ccd690b 100644 --- a/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringMethodTranslator.cs +++ b/src/EFCore.Sqlite.Core/Query/Internal/SqliteStringMethodTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteStringMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _indexOfMethodInfo @@ -74,11 +80,23 @@ private static readonly MethodInfo _endsWithMethodInfo private readonly ISqlExpressionFactory _sqlExpressionFactory; private const char LikeEscapeChar = '\\'; + /// + /// 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 SqliteStringMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMemberTranslator.cs index 2baa5017fe8..da81ed3dc4f 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMemberTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteGeometryCollectionMemberTranslator : IMemberTranslator { private static readonly MemberInfo _count = typeof(GeometryCollection).GetRuntimeProperty(nameof(GeometryCollection.Count)); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteGeometryCollectionMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMethodTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMethodTranslator.cs index 3994c6893fa..3f41df868c7 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMethodTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryCollectionMethodTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteGeometryCollectionMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _item = typeof(GeometryCollection).GetRuntimeProperty("Item").GetMethod; private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteGeometryCollectionMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMemberTranslator.cs index ed541aa97ee..f422283339b 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMemberTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteGeometryMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName = new Dictionary @@ -36,11 +42,23 @@ public class SqliteGeometryMemberTranslator : IMemberTranslator private static readonly MemberInfo _ogcGeometryType = typeof(Geometry).GetRuntimeProperty(nameof(Geometry.OgcGeometryType)); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteGeometryMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMethodTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMethodTranslator.cs index de9341b1dd0..7bff9b15805 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMethodTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteGeometryMethodTranslator.cs @@ -13,6 +13,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteGeometryMethodTranslator : IMethodCallTranslator { private static readonly IDictionary _methodToFunctionName = new Dictionary @@ -52,11 +58,23 @@ public class SqliteGeometryMethodTranslator : IMethodCallTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteGeometryMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMemberTranslator.cs index 7d0167eb222..234ac14253e 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMemberTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteLineStringMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName @@ -26,11 +32,23 @@ private static readonly IDictionary _memberToFunctionName private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteLineStringMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMethodTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMethodTranslator.cs index c12b586c977..9b1bbdd880b 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMethodTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteLineStringMethodTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteLineStringMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _getPointN @@ -18,11 +24,23 @@ private static readonly MethodInfo _getPointN private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteLineStringMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteMultiLineStringMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteMultiLineStringMemberTranslator.cs index 2581a787e77..f79d09c731e 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteMultiLineStringMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteMultiLineStringMemberTranslator.cs @@ -11,16 +11,34 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqliteMultiLineStringMemberTranslator : IMemberTranslator { private static readonly MemberInfo _isClosed = typeof(MultiLineString).GetRuntimeProperty(nameof(MultiLineString.IsClosed)); private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqliteMultiLineStringMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMemberTranslatorPlugin.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMemberTranslatorPlugin.cs index f7162401bb0..d5db14afea3 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMemberTranslatorPlugin.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMemberTranslatorPlugin.cs @@ -23,6 +23,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal /// public class SqliteNetTopologySuiteMemberTranslatorPlugin : IMemberTranslatorPlugin { + /// + /// 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 SqliteNetTopologySuiteMemberTranslatorPlugin( [NotNull] ISqlExpressionFactory sqlExpressionFactory) { diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs index c0029c0a4d0..0c706b434c2 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqliteNetTopologySuiteMethodCallTranslatorPlugin.cs @@ -24,6 +24,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal /// public class SqliteNetTopologySuiteMethodCallTranslatorPlugin : IMethodCallTranslatorPlugin { + /// + /// 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 SqliteNetTopologySuiteMethodCallTranslatorPlugin([NotNull] ISqlExpressionFactory sqlExpressionFactory) { Translators = new IMethodCallTranslator[] diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePointMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePointMemberTranslator.cs index 3bfc553061d..433d2ac820b 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePointMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePointMemberTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqlitePointMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName = new Dictionary @@ -24,11 +30,23 @@ public class SqlitePointMemberTranslator : IMemberTranslator private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlitePointMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMemberTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMemberTranslator.cs index e53d1116365..df0a65ec13d 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMemberTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMemberTranslator.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqlitePolygonMemberTranslator : IMemberTranslator { private static readonly IDictionary _memberToFunctionName @@ -23,11 +29,23 @@ private static readonly IDictionary _memberToFunctionName private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlitePolygonMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MemberInfo member, Type returnType) { Check.NotNull(member, nameof(member)); diff --git a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMethodTranslator.cs b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMethodTranslator.cs index 6937d311d5b..ed9484d5327 100644 --- a/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMethodTranslator.cs +++ b/src/EFCore.Sqlite.NTS/Query/Internal/SqlitePolygonMethodTranslator.cs @@ -11,6 +11,12 @@ namespace Microsoft.EntityFrameworkCore.Sqlite.Query.Internal { + /// + /// 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 class SqlitePolygonMethodTranslator : IMethodCallTranslator { private static readonly MethodInfo _getInteriorRingN @@ -18,11 +24,23 @@ private static readonly MethodInfo _getInteriorRingN private readonly ISqlExpressionFactory _sqlExpressionFactory; + /// + /// 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 SqlitePolygonMethodTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory) { _sqlExpressionFactory = sqlExpressionFactory; } + /// + /// 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 virtual SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadOnlyList arguments) { Check.NotNull(method, nameof(method)); diff --git a/src/EFCore/Extensions/EntityTypeExtensions.cs b/src/EFCore/Extensions/EntityTypeExtensions.cs index 4a4b788d5b6..bee8ecbfa9a 100644 --- a/src/EFCore/Extensions/EntityTypeExtensions.cs +++ b/src/EFCore/Extensions/EntityTypeExtensions.cs @@ -22,6 +22,11 @@ namespace Microsoft.EntityFrameworkCore /// public static class EntityTypeExtensions { + /// + /// Returns all the derived types of the given , including the type itself, which are not abstract. + /// + /// The entity type. + /// Non-abstract, derived types. public static IEnumerable GetConcreteDerivedTypesInclusive([NotNull] this IEntityType entityType) => entityType.GetDerivedTypesInclusive().Where(et => !et.IsAbstract()); diff --git a/src/EFCore/Extensions/IndexExtensions.cs b/src/EFCore/Extensions/IndexExtensions.cs index e7d68630a15..1773e1be15d 100644 --- a/src/EFCore/Extensions/IndexExtensions.cs +++ b/src/EFCore/Extensions/IndexExtensions.cs @@ -9,6 +9,9 @@ // ReSharper disable once CheckNamespace namespace Microsoft.EntityFrameworkCore { + /// + /// Extension methods for . + /// public static class IndexExtensions { /// diff --git a/src/EFCore/Infrastructure/CoreOptionsExtension.cs b/src/EFCore/Infrastructure/CoreOptionsExtension.cs index 770389c8466..ad783ee283c 100644 --- a/src/EFCore/Infrastructure/CoreOptionsExtension.cs +++ b/src/EFCore/Infrastructure/CoreOptionsExtension.cs @@ -387,7 +387,9 @@ public virtual CoreOptionsExtension WithInterceptors([NotNull] IEnumerable public virtual int? MaxPoolSize => _maxPoolSize; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public virtual IEnumerable Interceptors => _interceptors; +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member /// /// Adds the services required to make the selected options work. This is used when there diff --git a/src/EFCore/Infrastructure/ExpressionExtensions.cs b/src/EFCore/Infrastructure/ExpressionExtensions.cs index 00814f26495..66c5913814c 100644 --- a/src/EFCore/Infrastructure/ExpressionExtensions.cs +++ b/src/EFCore/Infrastructure/ExpressionExtensions.cs @@ -33,7 +33,7 @@ public static class ExpressionExtensions /// Creates a printable string representation of the given expression. /// /// The expression. - /// An optional limit to the number of characters included. + /// An optional limit to the number of characters included. Additional output will be truncated. /// The printable representation. public static string Print([NotNull] this Expression expression, int? characterLimit = null) => new ExpressionPrinter().Print(Check.NotNull(expression, nameof(expression)), characterLimit); diff --git a/src/EFCore/Infrastructure/IndentedStringBuilder.cs b/src/EFCore/Infrastructure/IndentedStringBuilder.cs index 154df24989e..576eca00612 100644 --- a/src/EFCore/Infrastructure/IndentedStringBuilder.cs +++ b/src/EFCore/Infrastructure/IndentedStringBuilder.cs @@ -150,7 +150,7 @@ public virtual IndentedStringBuilder DecrementIndent() } /// - /// Creates a scoped indenter that will increment the index, then decrement it when disposed. + /// Creates a scoped indenter that will increment the indent, then decrement it when disposed. /// /// An indenter. public virtual IDisposable Indent() => new Indenter(this); diff --git a/src/EFCore/Infrastructure/ProductInfo.cs b/src/EFCore/Infrastructure/ProductInfo.cs index bb7a248d51d..7903b00d11e 100644 --- a/src/EFCore/Infrastructure/ProductInfo.cs +++ b/src/EFCore/Infrastructure/ProductInfo.cs @@ -5,9 +5,13 @@ namespace Microsoft.EntityFrameworkCore.Infrastructure { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public static class ProductInfo +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public static string GetVersion() +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member => typeof(ProductInfo).Assembly .GetCustomAttribute().InformationalVersion; } diff --git a/src/EFCore/Metadata/Builders/IConventionNavigationBuilder.cs b/src/EFCore/Metadata/Builders/IConventionNavigationBuilder.cs index 84f012b84d7..524f78164f3 100644 --- a/src/EFCore/Metadata/Builders/IConventionNavigationBuilder.cs +++ b/src/EFCore/Metadata/Builders/IConventionNavigationBuilder.cs @@ -5,7 +5,9 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Builders { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public interface IConventionNavigationBuilder : IConventionAnnotatableBuilder +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member { /// /// Gets the navigation being configured. diff --git a/src/EFCore/Metadata/Conventions/QueryFilterDefiningQueryRewritingConvention.cs b/src/EFCore/Metadata/Conventions/QueryFilterDefiningQueryRewritingConvention.cs index 9380de3c33d..ea217da15ae 100644 --- a/src/EFCore/Metadata/Conventions/QueryFilterDefiningQueryRewritingConvention.cs +++ b/src/EFCore/Metadata/Conventions/QueryFilterDefiningQueryRewritingConvention.cs @@ -12,7 +12,7 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions { /// - /// Convention that converts accesses of DbSets inside query filters and defining queries into EntityQueryables. + /// Convention that converts accesses of inside query filters and defining queries into . /// This makes them consistent with how DbSet accesses in the actual queries are represented, which allows for easier processing in the /// query pipeline. /// @@ -34,7 +34,7 @@ public QueryFilterDefiningQueryRewritingConvention([NotNull] ProviderConventionS protected virtual ProviderConventionSetBuilderDependencies Dependencies { get; } /// - /// Visitor used to rewrite DbSets accesses encountered in query filters and defining queries to EntityQueryables. + /// Visitor used to rewrite accesses encountered in query filters and defining queries to . /// protected virtual DbSetAccessRewritingExpressionVisitor DbSetAccessRewriter { get; [param: NotNull] set; } @@ -59,16 +59,28 @@ public virtual void ProcessModelFinalizing( } } + /// + /// A visitor that rewrites DbSet accesses encountered in query filters and defining queries to . + /// protected class DbSetAccessRewritingExpressionVisitor : ExpressionVisitor { private readonly Type _contextType; private IModel _model; + /// + /// Creates a new instance of . + /// + /// The clr type of derived DbContext. public DbSetAccessRewritingExpressionVisitor(Type contextType) { _contextType = contextType; } + /// + /// Rewrites DbSet accesses encountered in query filters and defining queries to . + /// + /// The model to look for entity types. + /// The query filter or defining query expression to rewrite. public Expression Rewrite(IModel model, Expression expression) { _model = model; @@ -76,6 +88,7 @@ public Expression Rewrite(IModel model, Expression expression) return Visit(expression); } + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -93,6 +106,7 @@ protected override Expression VisitMember(MemberExpression memberExpression) return base.VisitMember(memberExpression); } + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); diff --git a/src/EFCore/Metadata/Internal/EntityType.cs b/src/EFCore/Metadata/Internal/EntityType.cs index afc708bb812..23ed133e026 100644 --- a/src/EFCore/Metadata/Internal/EntityType.cs +++ b/src/EFCore/Metadata/Internal/EntityType.cs @@ -2897,6 +2897,12 @@ private void CheckDiscriminatorProperty(Property property) } } + /// + /// 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 virtual void CheckDiscriminatorValue([NotNull] IEntityType entityType, [CanBeNull] object value) { if (value != null diff --git a/src/EFCore/Metadata/Internal/PropertyNameComparer.cs b/src/EFCore/Metadata/Internal/PropertyNameComparer.cs index 9c740341b2a..27a944146d0 100644 --- a/src/EFCore/Metadata/Internal/PropertyNameComparer.cs +++ b/src/EFCore/Metadata/Internal/PropertyNameComparer.cs @@ -17,11 +17,23 @@ public sealed class PropertyNameComparer : IComparer { private readonly EntityType _entityType; + /// + /// 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 PropertyNameComparer([NotNull] EntityType entityType) { _entityType = entityType; } + /// + /// 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 int Compare(string x, string y) { var xIndex = -1; diff --git a/src/EFCore/Metadata/Internal/SkipNavigationComparer.cs b/src/EFCore/Metadata/Internal/SkipNavigationComparer.cs index 92fcbe356d3..a5a23edb108 100644 --- a/src/EFCore/Metadata/Internal/SkipNavigationComparer.cs +++ b/src/EFCore/Metadata/Internal/SkipNavigationComparer.cs @@ -26,6 +26,12 @@ private SkipNavigationComparer() /// public static readonly SkipNavigationComparer Instance = new SkipNavigationComparer(); + /// + /// 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 int Compare(SkipNavigation x, SkipNavigation y) { var result = StringComparer.Ordinal.Compare(x.Name, y.Name); diff --git a/src/EFCore/Query/CollectionShaperExpression.cs b/src/EFCore/Query/CollectionShaperExpression.cs index 93922a1cf85..eadeb6a93da 100644 --- a/src/EFCore/Query/CollectionShaperExpression.cs +++ b/src/EFCore/Query/CollectionShaperExpression.cs @@ -10,8 +10,24 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents creation of a collection in . + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class CollectionShaperExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class. + /// + /// An expression reprensenting how to get value from query to create the collection. + /// An expression used to create individual elements of the collection. + /// A navigation associated with this collection, if any. + /// The clr type of individual elements in the collection. public CollectionShaperExpression( [NotNull] Expression projection, [NotNull] Expression innerShaper, @@ -27,6 +43,29 @@ public CollectionShaperExpression( ElementType = elementType ?? navigation.ClrType.TryGetSequenceType(); } + /// + /// The expression to get value from query for this collection. + /// + public virtual Expression Projection { get; } + /// + /// The expression to create inner elements. + /// + public virtual Expression InnerShaper { get; } + /// + /// The navigation if associated with the collection. + /// + public virtual INavigation Navigation { get; } + /// + /// The clr type of elements of the collection. + /// + public virtual Type ElementType { get; } + + /// + public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// + public override Type Type => Navigation?.ClrType ?? typeof(List<>).MakeGenericType(ElementType); + + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -37,6 +76,13 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(projection, innerShaper); } + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual CollectionShaperExpression Update( [NotNull] Expression projection, [NotNull] Expression innerShaper) @@ -49,14 +95,7 @@ public virtual CollectionShaperExpression Update( : this; } - public sealed override ExpressionType NodeType => ExpressionType.Extension; - public override Type Type => Navigation?.ClrType ?? typeof(List<>).MakeGenericType(ElementType); - - public virtual Expression Projection { get; } - public virtual Expression InnerShaper { get; } - public virtual INavigation Navigation { get; } - public virtual Type ElementType { get; } - + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore/Query/EntityShaperExpression.cs b/src/EFCore/Query/EntityShaperExpression.cs index ab4a4ac2d78..a7226238e71 100644 --- a/src/EFCore/Query/EntityShaperExpression.cs +++ b/src/EFCore/Query/EntityShaperExpression.cs @@ -15,6 +15,15 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents creation of an entity instance in . + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class EntityShaperExpression : Expression, IPrintableExpression { private static readonly MethodInfo _createUnableToDiscriminateException @@ -25,6 +34,12 @@ private static readonly MethodInfo _createUnableToDiscriminateException private static Exception CreateUnableToDiscriminateException(IEntityType entityType, object discriminator) => new InvalidOperationException(CoreStrings.UnableToDiscriminate(entityType.DisplayName(), discriminator?.ToString())); + /// + /// Creates a new instance of the class. + /// + /// The entity type to shape. + /// An expression of ValueBuffer to get values for properties of the entity. + /// A bool value indicating whether this entity instance can be null. public EntityShaperExpression( [NotNull] IEntityType entityType, [NotNull] Expression valueBufferExpression, @@ -33,6 +48,13 @@ public EntityShaperExpression( { } + /// + /// Creates a new instance of the class. + /// + /// The entity type to shape. + /// An expression of ValueBuffer to get values for properties of the entity. + /// Whether this entity instance can be null. + /// An expression of to determine which entity type to materialize. protected EntityShaperExpression( [NotNull] IEntityType entityType, [NotNull] Expression valueBufferExpression, @@ -59,6 +81,12 @@ protected EntityShaperExpression( MaterializationCondition = materializationCondition; } + /// + /// Creates an expression of to determine which entity type to materialize. + /// + /// The entity type to create materialization condition for. + /// Whether this entity instance can be null. + /// An expression of representing materilization condition for the entity type. protected virtual LambdaExpression GenerateMaterializationCondition([NotNull] IEntityType entityType, bool nullable) { Check.NotNull(entityType, nameof(EntityType)); @@ -114,11 +142,24 @@ protected virtual LambdaExpression GenerateMaterializationCondition([NotNull] IE return Lambda(body, valueBufferParameter); } + /// + /// The entity type being shaped. + /// public virtual IEntityType EntityType { get; } + /// + /// The expression representing a to get values from that are used to create the entity instance. + /// public virtual Expression ValueBufferExpression { get; } + /// + /// A value indicating whether this entity instance can be null. + /// public virtual bool IsNullable { get; } + /// + /// The materilization condition to use for shaping this entity. + /// public virtual LambdaExpression MaterializationCondition { get; } + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -128,6 +169,11 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(valueBufferExpression); } + /// + /// Changes the entity type being shaped by this entity shaper. + /// + /// The new entity type to use. + /// This expression if entity type not changed, or an expression with updated entity type. public virtual EntityShaperExpression WithEntityType([NotNull] IEntityType entityType) { Check.NotNull(entityType, nameof(entityType)); @@ -137,12 +183,22 @@ public virtual EntityShaperExpression WithEntityType([NotNull] IEntityType entit : this; } + /// + /// Marks this shaper as nullable, indicating that it can shape null entity instances. + /// + /// This expression if nullability not changed, or an expression with updated nullability. public virtual EntityShaperExpression MarkAsNullable() => !IsNullable // Marking nullable requires recomputation of materialization condition ? new EntityShaperExpression(EntityType, ValueBufferExpression, true) : this; + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual EntityShaperExpression Update([NotNull] Expression valueBufferExpression) { Check.NotNull(valueBufferExpression, nameof(valueBufferExpression)); @@ -152,10 +208,13 @@ public virtual EntityShaperExpression Update([NotNull] Expression valueBufferExp : this; } + /// public override Type Type => EntityType.ClrType; + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore/Query/ExpressionEqualityComparer.cs b/src/EFCore/Query/ExpressionEqualityComparer.cs index 6e8d90667fc..3959806ae3e 100644 --- a/src/EFCore/Query/ExpressionEqualityComparer.cs +++ b/src/EFCore/Query/ExpressionEqualityComparer.cs @@ -13,6 +13,9 @@ // ReSharper disable LoopCanBeConvertedToQuery namespace Microsoft.EntityFrameworkCore.Query { + /// + /// A comparer which implements for . + /// public class ExpressionEqualityComparer : IEqualityComparer { /// diff --git a/src/EFCore/Query/ExpressionPrinter.cs b/src/EFCore/Query/ExpressionPrinter.cs index 760394e8f9e..5b9c0c9f2ff 100644 --- a/src/EFCore/Query/ExpressionPrinter.cs +++ b/src/EFCore/Query/ExpressionPrinter.cs @@ -15,8 +15,24 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class to create a printable string representation of expression. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class ExpressionPrinter : ExpressionVisitor { + private static readonly List _simpleMethods = new List + { + "get_Item", + "TryReadValue", + "ReferenceEquals" + }; + private readonly IndentedStringBuilder _stringBuilder; private readonly Dictionary _parametersInScope; private readonly List _namelessParameters; @@ -44,6 +60,9 @@ public class ExpressionPrinter : ExpressionVisitor { ExpressionType.ExclusiveOr, " ^ " } }; + /// + /// Creates a new instance of the class. + /// public ExpressionPrinter() { _stringBuilder = new IndentedStringBuilder(); @@ -55,8 +74,12 @@ public ExpressionPrinter() private int? CharacterLimit { get; set; } private bool Verbose { get; set; } - public virtual void VisitCollection( - [NotNull] IReadOnlyCollection items, + /// + /// Visit given readonly collection of expression for printing. + /// + /// A collection of items to print. + /// A join action to use when joining printout of individual item in the collection. + public virtual void VisitCollection([NotNull] IReadOnlyCollection items, [CanBeNull] Action joinAction = null) where T : Expression { @@ -80,44 +103,77 @@ public virtual void VisitCollection( } } + /// + /// Appends a new line to current output being built. + /// + /// This printer so additional calls can be chained. public virtual ExpressionPrinter AppendLine() { _stringBuilder.AppendLine(); return this; } + /// + /// Appends the given string and a new line to current output being built. + /// + /// The string to append. + /// This printer so additional calls can be chained. public virtual ExpressionVisitor AppendLine([NotNull] string value) { _stringBuilder.AppendLine(value); return this; } + /// + /// Appends all the lines to current output being built. + /// + /// The string to append. + /// If true, then a terminating new line is not added. + /// This printer so additional calls can be chained. public virtual ExpressionPrinter AppendLines([NotNull] string value, bool skipFinalNewline = false) { _stringBuilder.AppendLines(value, skipFinalNewline); return this; } + /// + /// Creates a scoped indenter that will increment the indent, then decrement it when disposed. + /// + /// An indenter. public virtual IDisposable Indent() => _stringBuilder.Indent(); - public virtual ExpressionPrinter Append([NotNull] string message) + /// + /// Appends the given string to current output being built. + /// + /// The string to append. + /// This printer so additional calls can be chained. + public virtual ExpressionPrinter Append([NotNull] string value) { - _stringBuilder.Append(message); + _stringBuilder.Append(value); return this; } + /// + /// Creates a printable string representation of the given expression. + /// + /// The expression to print. + /// An optional limit to the number of characters included. Additional output will be truncated. + /// The printable representation. public virtual string Print( [NotNull] Expression expression, int? characterLimit = null) => PrintCore(expression, characterLimit, verbose: false); + /// + /// Creates a printable verbose string representation of the given expression. + /// + /// The expression to print. + /// The printable representation. public virtual string PrintDebug( - [NotNull] Expression expression, - int? characterLimit = null, - bool verbose = true) - => PrintCore(expression, characterLimit, verbose); + [NotNull] Expression expression) + => PrintCore(expression, characterLimit: null, verbose: true); - protected virtual string PrintCore( + private string PrintCore( [NotNull] Expression expression, int? characterLimit, bool verbose) @@ -147,11 +203,17 @@ protected virtual string PrintCore( return queryPlan; } + /// + /// Returns binary operator string corresponding to given . + /// + /// The expression type to generate binary operator for. + /// The binary operator string. public virtual string GenerateBinaryOperator(ExpressionType expressionType) { return _binaryOperandMap[expressionType]; } + /// public override Expression Visit(Expression expression) { if (expression == null) @@ -277,6 +339,7 @@ public override Expression Visit(Expression expression) return expression; } + /// protected override Expression VisitBinary(BinaryExpression binaryExpression) { Check.NotNull(binaryExpression, nameof(binaryExpression)); @@ -308,6 +371,7 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression) return binaryExpression; } + /// protected override Expression VisitBlock(BlockExpression blockExpression) { Check.NotNull(blockExpression, nameof(blockExpression)); @@ -352,6 +416,7 @@ protected override Expression VisitBlock(BlockExpression blockExpression) return blockExpression; } + /// protected override Expression VisitConditional(ConditionalExpression conditionalExpression) { Check.NotNull(conditionalExpression, nameof(conditionalExpression)); @@ -369,6 +434,7 @@ protected override Expression VisitConditional(ConditionalExpression conditional return conditionalExpression; } + /// protected override Expression VisitConstant(ConstantExpression constantExpression) { Check.NotNull(constantExpression, nameof(constantExpression)); @@ -416,6 +482,7 @@ private void Print(object value) _stringBuilder.Append(stringValue); } + /// protected override Expression VisitGoto(GotoExpression gotoExpression) { Check.NotNull(gotoExpression, nameof(gotoExpression)); @@ -431,6 +498,7 @@ protected override Expression VisitGoto(GotoExpression gotoExpression) return gotoExpression; } + /// protected override Expression VisitLabel(LabelExpression labelExpression) { Check.NotNull(labelExpression, nameof(labelExpression)); @@ -440,6 +508,7 @@ protected override Expression VisitLabel(LabelExpression labelExpression) return labelExpression; } + /// protected override Expression VisitLambda(Expression lambdaExpression) { Check.NotNull(lambdaExpression, nameof(lambdaExpression)); @@ -484,6 +553,7 @@ protected override Expression VisitLambda(Expression lambdaExpression) return lambdaExpression; } + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -513,6 +583,7 @@ protected override Expression VisitMember(MemberExpression memberExpression) return memberExpression; } + /// protected override Expression VisitMemberInit(MemberInitExpression memberInitExpression) { Check.NotNull(memberInitExpression, nameof(memberInitExpression)); @@ -543,13 +614,7 @@ protected override Expression VisitMemberInit(MemberInitExpression memberInitExp return memberInitExpression; } - private static readonly List _simpleMethods = new List - { - "get_Item", - "TryReadValue", - "ReferenceEquals" - }; - + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); @@ -681,6 +746,7 @@ static void PrintGenericArguments(MethodInfo method, IndentedStringBuilder strin } } + /// protected override Expression VisitNew(NewExpression newExpression) { Check.NotNull(newExpression, nameof(newExpression)); @@ -735,6 +801,7 @@ protected override Expression VisitNew(NewExpression newExpression) return newExpression; } + /// protected override Expression VisitNewArray(NewArrayExpression newArrayExpression) { Check.NotNull(newArrayExpression, nameof(newArrayExpression)); @@ -763,6 +830,7 @@ protected override Expression VisitNewArray(NewArrayExpression newArrayExpressio return newArrayExpression; } + /// protected override Expression VisitParameter(ParameterExpression parameterExpression) { Check.NotNull(parameterExpression, nameof(parameterExpression)); @@ -824,6 +892,7 @@ protected override Expression VisitParameter(ParameterExpression parameterExpres return parameterExpression; } + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { Check.NotNull(unaryExpression, nameof(unaryExpression)); @@ -876,6 +945,7 @@ protected override Expression VisitUnary(UnaryExpression unaryExpression) return unaryExpression; } + /// protected override Expression VisitDefault(DefaultExpression defaultExpression) { Check.NotNull(defaultExpression, nameof(defaultExpression)); @@ -885,6 +955,7 @@ protected override Expression VisitDefault(DefaultExpression defaultExpression) return defaultExpression; } + /// protected override Expression VisitTry(TryExpression tryExpression) { Check.NotNull(tryExpression, nameof(tryExpression)); @@ -901,6 +972,7 @@ protected override Expression VisitTry(TryExpression tryExpression) return tryExpression; } + /// protected override Expression VisitIndex(IndexExpression indexExpression) { Check.NotNull(indexExpression, nameof(indexExpression)); @@ -917,6 +989,7 @@ protected override Expression VisitIndex(IndexExpression indexExpression) return indexExpression; } + /// protected override Expression VisitTypeBinary(TypeBinaryExpression typeBinaryExpression) { Check.NotNull(typeBinaryExpression, nameof(typeBinaryExpression)); @@ -928,6 +1001,7 @@ protected override Expression VisitTypeBinary(TypeBinaryExpression typeBinaryExp return typeBinaryExpression; } + /// protected override Expression VisitSwitch(SwitchExpression switchExpression) { _stringBuilder.Append("switch ("); @@ -970,6 +1044,7 @@ protected override Expression VisitSwitch(SwitchExpression switchExpression) return switchExpression; } + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -1004,7 +1079,7 @@ private void VisitArguments( } } - protected virtual string PostProcess([NotNull] string printedExpression) + private string PostProcess([NotNull] string printedExpression) { var processedPrintedExpression = printedExpression .Replace("Microsoft.EntityFrameworkCore.Query.", "") diff --git a/src/EFCore/Query/GroupByShaperExpression.cs b/src/EFCore/Query/GroupByShaperExpression.cs index 6fabdce63bc..581047c97a3 100644 --- a/src/EFCore/Query/GroupByShaperExpression.cs +++ b/src/EFCore/Query/GroupByShaperExpression.cs @@ -9,8 +9,22 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents creation of a grouping element in . + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class GroupByShaperExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class. + /// + /// An expression representing key selector for the grouping element. + /// An expression representing element selector for the grouping element. public GroupByShaperExpression( [NotNull] Expression keySelector, [NotNull] Expression elementSelector) @@ -22,25 +36,21 @@ public GroupByShaperExpression( ElementSelector = elementSelector; } + /// + /// The expression representing the key selector for this grouping element. + /// public virtual Expression KeySelector { get; } + /// + /// The expression representing the element selector for this grouping element. + /// public virtual Expression ElementSelector { get; } + /// public override Type Type => typeof(IGrouping<,>).MakeGenericType(KeySelector.Type, ElementSelector.Type); + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; - public virtual void Print(ExpressionPrinter expressionPrinter) - { - Check.NotNull(expressionPrinter, nameof(expressionPrinter)); - - expressionPrinter.AppendLine($"{nameof(GroupByShaperExpression)}:"); - expressionPrinter.Append("KeySelector: "); - expressionPrinter.Visit(KeySelector); - expressionPrinter.AppendLine(", "); - expressionPrinter.Append("ElementSelector:"); - expressionPrinter.Visit(ElementSelector); - expressionPrinter.AppendLine(); - } - + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -51,6 +61,13 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(keySelector, elementSelector); } + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual GroupByShaperExpression Update([NotNull] Expression keySelector, [NotNull] Expression elementSelector) { Check.NotNull(keySelector, nameof(keySelector)); @@ -60,5 +77,19 @@ public virtual GroupByShaperExpression Update([NotNull] Expression keySelector, ? new GroupByShaperExpression(keySelector, elementSelector) : this; } + + /// + public virtual void Print(ExpressionPrinter expressionPrinter) + { + Check.NotNull(expressionPrinter, nameof(expressionPrinter)); + + expressionPrinter.AppendLine($"{nameof(GroupByShaperExpression)}:"); + expressionPrinter.Append("KeySelector: "); + expressionPrinter.Visit(KeySelector); + expressionPrinter.AppendLine(", "); + expressionPrinter.Append("ElementSelector:"); + expressionPrinter.Visit(ElementSelector); + expressionPrinter.AppendLine(); + } } } diff --git a/src/EFCore/Query/IParameterValues.cs b/src/EFCore/Query/IParameterValues.cs deleted file mode 100644 index 6164bcbdcdd..00000000000 --- a/src/EFCore/Query/IParameterValues.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using JetBrains.Annotations; - -namespace Microsoft.EntityFrameworkCore.Query -{ - public interface IParameterValues - { - IReadOnlyDictionary ParameterValues { get; } - - void AddParameter([NotNull] string name, [CanBeNull] object value); - } -} diff --git a/src/EFCore/Query/IPrintableExpression.cs b/src/EFCore/Query/IPrintableExpression.cs index c3c3df153c2..2dff03cfe3d 100644 --- a/src/EFCore/Query/IPrintableExpression.cs +++ b/src/EFCore/Query/IPrintableExpression.cs @@ -5,8 +5,22 @@ namespace Microsoft.EntityFrameworkCore.Query { + + /// + /// + /// An interface that allows printing via . + /// + /// + /// This interface is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public interface IPrintableExpression { + /// + /// Creates a printable string representation of the given expression using . + /// + /// The expression printer to use. void Print([NotNull] ExpressionPrinter expressionPrinter); } } diff --git a/src/EFCore/Query/IQueryCompilationContextFactory.cs b/src/EFCore/Query/IQueryCompilationContextFactory.cs index 77b9f004a36..5d7de27278f 100644 --- a/src/EFCore/Query/IQueryCompilationContextFactory.cs +++ b/src/EFCore/Query/IQueryCompilationContextFactory.cs @@ -18,6 +18,11 @@ namespace Microsoft.EntityFrameworkCore.Query /// public interface IQueryCompilationContextFactory { + /// + /// Creates a new . + /// + /// Specifies whether the query is async. + /// The created query compilation context. QueryCompilationContext Create(bool async); } } diff --git a/src/EFCore/Query/IQueryTranslationPostprocessorFactory.cs b/src/EFCore/Query/IQueryTranslationPostprocessorFactory.cs index 4fe2bf04778..52a06d8259f 100644 --- a/src/EFCore/Query/IQueryTranslationPostprocessorFactory.cs +++ b/src/EFCore/Query/IQueryTranslationPostprocessorFactory.cs @@ -18,6 +18,11 @@ namespace Microsoft.EntityFrameworkCore.Query /// public interface IQueryTranslationPostprocessorFactory { + /// + /// Creates a new for given . + /// + /// The query compilation context to use. + /// The created visitor. QueryTranslationPostprocessor Create([NotNull] QueryCompilationContext queryCompilationContext); } } diff --git a/src/EFCore/Query/IQueryTranslationPreprocessorFactory.cs b/src/EFCore/Query/IQueryTranslationPreprocessorFactory.cs index 6067aeb65ed..5e15812f6ee 100644 --- a/src/EFCore/Query/IQueryTranslationPreprocessorFactory.cs +++ b/src/EFCore/Query/IQueryTranslationPreprocessorFactory.cs @@ -18,6 +18,11 @@ namespace Microsoft.EntityFrameworkCore.Query /// public interface IQueryTranslationPreprocessorFactory { + /// + /// Creates a new for given . + /// + /// The query compilation context to use. + /// The created visitor. QueryTranslationPreprocessor Create([NotNull] QueryCompilationContext queryCompilationContext); } } diff --git a/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs index 6a818be46b2..3d4a0e65a29 100644 --- a/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/EFCore/Query/IQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -18,6 +18,11 @@ namespace Microsoft.EntityFrameworkCore.Query /// public interface IQueryableMethodTranslatingExpressionVisitorFactory { + /// + /// Creates a new for given . + /// + /// The query compilation context to use. + /// The created visitor. QueryableMethodTranslatingExpressionVisitor Create([NotNull] QueryCompilationContext queryCompilationContext); } } diff --git a/src/EFCore/Query/IShapedQueryCompilingExpressionVisitorFactory.cs b/src/EFCore/Query/IShapedQueryCompilingExpressionVisitorFactory.cs index 0db1452263a..7c57ec51b26 100644 --- a/src/EFCore/Query/IShapedQueryCompilingExpressionVisitorFactory.cs +++ b/src/EFCore/Query/IShapedQueryCompilingExpressionVisitorFactory.cs @@ -18,6 +18,11 @@ namespace Microsoft.EntityFrameworkCore.Query /// public interface IShapedQueryCompilingExpressionVisitorFactory { + /// + /// Creates a new for given . + /// + /// The query compilation context to use. + /// The created visitor. ShapedQueryCompilingExpressionVisitor Create([NotNull] QueryCompilationContext queryCompilationContext); } } diff --git a/src/EFCore/Query/IncludeExpression.cs b/src/EFCore/Query/IncludeExpression.cs index 0f69b957e2e..e96cf6835fa 100644 --- a/src/EFCore/Query/IncludeExpression.cs +++ b/src/EFCore/Query/IncludeExpression.cs @@ -9,8 +9,23 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents include operation in . + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class IncludeExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class. + /// + /// An expression to get entity which is performing include. + /// An expression to get included navigation element. + /// The navigation for this include operation. public IncludeExpression( [NotNull] Expression entityExpression, [NotNull] Expression navigationExpression, @@ -26,13 +41,25 @@ public IncludeExpression( Type = EntityExpression.Type; } + /// + /// The expression representing entity perfoming this include. + /// public virtual Expression EntityExpression { get; } + /// + /// The expression representing included navigation element. + /// public virtual Expression NavigationExpression { get; } + /// + /// The navigation associated with this include operation. + /// public virtual INavigation Navigation { get; } + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// public override Type Type { get; } + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -43,6 +70,13 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(newEntityExpression, newNavigationExpression); } + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual IncludeExpression Update([NotNull] Expression entityExpression, [NotNull] Expression navigationExpression) { Check.NotNull(entityExpression, nameof(entityExpression)); @@ -53,6 +87,7 @@ public virtual IncludeExpression Update([NotNull] Expression entityExpression, [ : this; } + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore/Query/EntityMaterializerSource.cs b/src/EFCore/Query/Internal/EntityMaterializerSource.cs similarity index 75% rename from src/EFCore/Query/EntityMaterializerSource.cs rename to src/EFCore/Query/Internal/EntityMaterializerSource.cs index 302bb79d27f..33b5a19d2b0 100644 --- a/src/EFCore/Query/EntityMaterializerSource.cs +++ b/src/EFCore/Query/Internal/EntityMaterializerSource.cs @@ -16,10 +16,16 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.Extensions.DependencyInjection; -namespace Microsoft.EntityFrameworkCore.Query +namespace Microsoft.EntityFrameworkCore.Query.Internal { /// /// + /// 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. + /// + /// /// 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 . @@ -29,10 +35,22 @@ public class EntityMaterializerSource : IEntityMaterializerSource { private ConcurrentDictionary> _materializers; + /// + /// 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 EntityMaterializerSource([NotNull] EntityMaterializerSourceDependencies dependencies) { } + /// + /// 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 virtual Expression CreateMaterializeExpression( IEntityType entityType, string entityInstanceName, @@ -134,6 +152,12 @@ private ConcurrentDictionary> ref _materializers, () => new ConcurrentDictionary>()); + /// + /// 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 virtual Func GetMaterializer(IEntityType entityType) => Materializers.GetOrAdd( entityType, e => diff --git a/src/EFCore/Query/EntityMaterializerSourceDependencies.cs b/src/EFCore/Query/Internal/EntityMaterializerSourceDependencies.cs similarity index 98% rename from src/EFCore/Query/EntityMaterializerSourceDependencies.cs rename to src/EFCore/Query/Internal/EntityMaterializerSourceDependencies.cs index 243bedbe2f4..1e513672fac 100644 --- a/src/EFCore/Query/EntityMaterializerSourceDependencies.cs +++ b/src/EFCore/Query/Internal/EntityMaterializerSourceDependencies.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.Extensions.DependencyInjection; -namespace Microsoft.EntityFrameworkCore.Query +namespace Microsoft.EntityFrameworkCore.Query.Internal { /// /// diff --git a/src/EFCore/Query/Internal/Grouping.cs b/src/EFCore/Query/Internal/Grouping.cs deleted file mode 100644 index f7ffaecae9c..00000000000 --- a/src/EFCore/Query/Internal/Grouping.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; - -namespace Microsoft.EntityFrameworkCore.Query.Internal -{ - /// - /// 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 class Grouping : IGrouping - { - private readonly List _elements = new List(); - - /// - /// 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 Grouping([CanBeNull] TKey key) - { - Key = key; - } - - /// - /// 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 virtual TKey Key { 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. - /// - public virtual void Add([CanBeNull] TElement element) => _elements.Add(element); - - /// - /// 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 virtual IEnumerator GetEnumerator() => _elements.GetEnumerator(); - - /// - /// 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. - /// - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } -} diff --git a/src/EFCore/Query/Internal/IParameterValues.cs b/src/EFCore/Query/Internal/IParameterValues.cs new file mode 100644 index 00000000000..ca63c1aa943 --- /dev/null +++ b/src/EFCore/Query/Internal/IParameterValues.cs @@ -0,0 +1,33 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using JetBrains.Annotations; + +namespace Microsoft.EntityFrameworkCore.Query.Internal +{ + /// + /// 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 interface IParameterValues + { + /// + /// 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. + /// + IReadOnlyDictionary ParameterValues { 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. + /// + void AddParameter([NotNull] string name, [CanBeNull] object value); + } +} diff --git a/src/EFCore/Query/Internal/InvocationExpressionRemovingExpressionVisitor.cs b/src/EFCore/Query/Internal/InvocationExpressionRemovingExpressionVisitor.cs index 720591b78fa..f9efa048d27 100644 --- a/src/EFCore/Query/Internal/InvocationExpressionRemovingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/InvocationExpressionRemovingExpressionVisitor.cs @@ -8,8 +8,20 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 class InvocationExpressionRemovingExpressionVisitor : ExpressionVisitor { + /// + /// 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. + /// protected override Expression VisitInvocation(InvocationExpression invocationExpression) { Check.NotNull(invocationExpression, nameof(invocationExpression)); diff --git a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs index 62045b12018..7224ebeae53 100644 --- a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs +++ b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs @@ -14,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { public partial class NavigationExpandingExpressionVisitor { - protected class EntityReference : Expression, IPrintableExpression + private sealed class EntityReference : Expression, IPrintableExpression { public EntityReference(IEntityType entityType) { @@ -22,12 +22,12 @@ public EntityReference(IEntityType entityType) IncludePaths = new IncludeTreeNode(entityType, this); } - public virtual IEntityType EntityType { get; } - public virtual IDictionary NavigationMap { get; } = new Dictionary(); + public IEntityType EntityType { get; } + public IDictionary NavigationMap { get; } = new Dictionary(); - public virtual bool IsOptional { get; private set; } - public virtual IncludeTreeNode IncludePaths { get; private set; } - public virtual IncludeTreeNode LastIncludeTreeNode { get; private set; } + public bool IsOptional { get; private set; } + public IncludeTreeNode IncludePaths { get; private set; } + public IncludeTreeNode LastIncludeTreeNode { get; private set; } public override ExpressionType NodeType => ExpressionType.Extension; public override Type Type => EntityType.ClrType; @@ -38,13 +38,13 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return this; } - public virtual void SetIncludePaths(IncludeTreeNode includePaths) + public void SetIncludePaths(IncludeTreeNode includePaths) { IncludePaths = includePaths; includePaths.SetEntityReference(this); } - public virtual EntityReference Clone() + public EntityReference Clone() { var result = new EntityReference(EntityType) { IsOptional = IsOptional }; result.IncludePaths = IncludePaths.Clone(result); @@ -52,11 +52,11 @@ public virtual EntityReference Clone() return result; } - public virtual void SetLastInclude(IncludeTreeNode lastIncludeTree) => LastIncludeTreeNode = lastIncludeTree; + public void SetLastInclude(IncludeTreeNode lastIncludeTree) => LastIncludeTreeNode = lastIncludeTree; - public virtual void MarkAsOptional() => IsOptional = true; + public void MarkAsOptional() => IsOptional = true; - public virtual void Print(ExpressionPrinter expressionPrinter) + public void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); @@ -80,11 +80,11 @@ public virtual void Print(ExpressionPrinter expressionPrinter) /// /// A tree structure of includes for a given entity type in . /// - protected class IncludeTreeNode : Dictionary + private sealed class IncludeTreeNode : Dictionary { private EntityReference _entityReference; - public virtual LambdaExpression FilterExpression { get; set; } + public LambdaExpression FilterExpression { get; set; } public IncludeTreeNode(IEntityType entityType, EntityReference entityReference) { @@ -92,9 +92,9 @@ public IncludeTreeNode(IEntityType entityType, EntityReference entityReference) _entityReference = entityReference; } - public virtual IEntityType EntityType { get; private set; } + public IEntityType EntityType { get; private set; } - public virtual IncludeTreeNode AddNavigation(INavigation navigation) + public IncludeTreeNode AddNavigation(INavigation navigation) { if (TryGetValue(navigation, out var existingValue)) { @@ -121,13 +121,13 @@ public virtual IncludeTreeNode AddNavigation(INavigation navigation) return this[navigation]; } - public virtual void SetEntityReference(EntityReference entityReference) + public void SetEntityReference(EntityReference entityReference) { _entityReference = entityReference; EntityType = entityReference.EntityType; } - public virtual IncludeTreeNode Clone(EntityReference entityReference) + public IncludeTreeNode Clone(EntityReference entityReference) { var result = new IncludeTreeNode(EntityType, entityReference); foreach (var kvp in this) @@ -170,7 +170,7 @@ private bool Equals(IncludeTreeNode includeTreeNode) /// Stores information about the current queryable, its source, structure of projection, parameter type etc. /// This is needed because once navigations are expanded we still remember these to avoid expanding again. /// - protected class NavigationExpansionExpression : Expression, IPrintableExpression + private sealed class NavigationExpansionExpression : Expression, IPrintableExpression { private readonly List<(MethodInfo OrderingMethod, Expression KeySelector)> _pendingOrderings = new List<(MethodInfo OrderingMethod, Expression KeySelector)>(); @@ -187,10 +187,10 @@ public NavigationExpansionExpression( PendingSelector = pendingSelector; } - public virtual Expression Source { get; private set; } - public virtual ParameterExpression CurrentParameter => CurrentTree.CurrentParameter; + public Expression Source { get; private set; } + public ParameterExpression CurrentParameter => CurrentTree.CurrentParameter; - public virtual NavigationTreeNode CurrentTree + public NavigationTreeNode CurrentTree { get => _currentTree; private set @@ -200,30 +200,30 @@ private set } } - public virtual Expression PendingSelector { get; private set; } - public virtual MethodInfo CardinalityReducingGenericMethodInfo { get; private set; } - public virtual Type SourceElementType => CurrentParameter.Type; - public virtual IReadOnlyList<(MethodInfo OrderingMethod, Expression KeySelector)> PendingOrderings => _pendingOrderings; + public Expression PendingSelector { get; private set; } + public MethodInfo CardinalityReducingGenericMethodInfo { get; private set; } + public Type SourceElementType => CurrentParameter.Type; + public IReadOnlyList<(MethodInfo OrderingMethod, Expression KeySelector)> PendingOrderings => _pendingOrderings; - public virtual void UpdateSource(Expression source) => Source = source; + public void UpdateSource(Expression source) => Source = source; - public virtual void UpdateCurrentTree(NavigationTreeNode currentTree) => CurrentTree = currentTree; + public void UpdateCurrentTree(NavigationTreeNode currentTree) => CurrentTree = currentTree; - public virtual void ApplySelector(Expression selector) => PendingSelector = selector; + public void ApplySelector(Expression selector) => PendingSelector = selector; - public virtual void AddPendingOrdering(MethodInfo orderingMethod, Expression keySelector) + public void AddPendingOrdering(MethodInfo orderingMethod, Expression keySelector) { _pendingOrderings.Clear(); _pendingOrderings.Add((orderingMethod, keySelector)); } - public virtual void AppendPendingOrdering(MethodInfo orderingMethod, Expression keySelector) + public void AppendPendingOrdering(MethodInfo orderingMethod, Expression keySelector) => _pendingOrderings.Add((orderingMethod, keySelector)); - public virtual void ClearPendingOrderings() + public void ClearPendingOrderings() => _pendingOrderings.Clear(); - public virtual void ConvertToSingleResult(MethodInfo genericMethod) + public void ConvertToSingleResult(MethodInfo genericMethod) => CardinalityReducingGenericMethodInfo = genericMethod; public override ExpressionType NodeType => ExpressionType.Extension; @@ -237,7 +237,7 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return this; } - public virtual void Print(ExpressionPrinter expressionPrinter) + public void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); @@ -260,10 +260,10 @@ public virtual void Print(ExpressionPrinter expressionPrinter) /// /// A leaf node on navigation tree, representing projection structures of - /// . Contains , + /// . Contains , /// which can be or . /// - protected class NavigationTreeExpression : NavigationTreeNode, IPrintableExpression + private sealed class NavigationTreeExpression : NavigationTreeNode, IPrintableExpression { public NavigationTreeExpression(Expression value) : base(null, null) @@ -274,7 +274,7 @@ public NavigationTreeExpression(Expression value) /// /// Either or . /// - public virtual Expression Value { get; private set; } + public Expression Value { get; private set; } protected override Expression VisitChildren(ExpressionVisitor visitor) { @@ -287,7 +287,7 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) public override Type Type => Value.Type; - public virtual void Print(ExpressionPrinter expressionPrinter) + public void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); @@ -308,7 +308,7 @@ public virtual void Print(ExpressionPrinter expressionPrinter) /// would be transparent identifier (hence it's a binary structure). This allows us to easily condense to /// inner/outer member access. /// - protected class NavigationTreeNode : Expression + private class NavigationTreeNode : Expression { private NavigationTreeNode _parent; @@ -323,7 +323,7 @@ public NavigationTreeNode(NavigationTreeNode left, NavigationTreeNode right) } } - public virtual NavigationTreeNode Parent + public NavigationTreeNode Parent { get => _parent; private set @@ -333,16 +333,16 @@ private set } } - public virtual NavigationTreeNode Left { get; } - public virtual NavigationTreeNode Right { get; } - public virtual ParameterExpression CurrentParameter { get; private set; } + public NavigationTreeNode Left { get; } + public NavigationTreeNode Right { get; } + public ParameterExpression CurrentParameter { get; private set; } - public virtual void SetParameter(string parameterName) => CurrentParameter = Parameter(Type, parameterName); + public void SetParameter(string parameterName) => CurrentParameter = Parameter(Type, parameterName); public override ExpressionType NodeType => ExpressionType.Extension; public override Type Type => TransparentIdentifierFactory.Create(Left.Type, Right.Type); - public virtual Expression GetExpression() + public Expression GetExpression() { if (Parent == null) { @@ -360,7 +360,7 @@ public virtual Expression GetExpression() /// Owned navigations are not expanded, since they map differently in different providers. /// This remembers such references so that they can still be treated like navigations. /// - protected class OwnedNavigationReference : Expression + private sealed class OwnedNavigationReference : Expression { public OwnedNavigationReference(Expression parent, INavigation navigation, EntityReference entityReference) { @@ -378,9 +378,9 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return this; } - public virtual Expression Parent { get; private set; } - public virtual INavigation Navigation { get; } - public virtual EntityReference EntityReference { get; } + public Expression Parent { get; private set; } + public INavigation Navigation { get; } + public EntityReference EntityReference { get; } public override Type Type => Navigation.ClrType; public override ExpressionType NodeType => ExpressionType.Extension; diff --git a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs index fbaf27181a0..c19a6c91961 100644 --- a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs @@ -16,6 +16,12 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 partial class NavigationExpandingExpressionVisitor : ExpressionVisitor { private static readonly PropertyInfo _queryContextContextPropertyInfo @@ -61,8 +67,12 @@ private readonly Dictionary _parameterizedQueryFi private readonly Parameters _parameters = new Parameters(); - protected virtual QueryCompilationContext QueryCompilationContext => _queryCompilationContext; - + /// + /// 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 NavigationExpandingExpressionVisitor( [NotNull] QueryTranslationPreprocessor queryTranslationPreprocessor, [NotNull] QueryCompilationContext queryCompilationContext, @@ -87,6 +97,12 @@ public NavigationExpandingExpressionVisitor( generateContextAccessors: true); } + /// + /// 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 virtual Expression Expand([NotNull] Expression query) { var result = Visit(query); @@ -120,6 +136,12 @@ public virtual Expression Expand([NotNull] Expression query) return result; } + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -135,7 +157,7 @@ protected override Expression VisitExtension(Expression extensionExpression) && queryRootExpression.GetType() == typeof(QueryRootExpression)) { var processedDefiningQueryBody = _parameterExtractingExpressionVisitor.ExtractParameters(definingQuery.Body); - processedDefiningQueryBody = _queryTranslationPreprocessor.NormalizeQueryableMethodCall(processedDefiningQueryBody); + processedDefiningQueryBody = _queryTranslationPreprocessor.NormalizeQueryableMethod(processedDefiningQueryBody); processedDefiningQueryBody = _nullCheckRemovingExpressionVisitor.Visit(processedDefiningQueryBody); processedDefiningQueryBody = new SelfReferenceEntityQueryableRewritingExpressionVisitor(this, entityType).Visit(processedDefiningQueryBody); @@ -161,6 +183,12 @@ protected override Expression VisitExtension(Expression extensionExpression) } } + /// + /// 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. + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -200,6 +228,12 @@ protected override Expression VisitMember(MemberExpression memberExpression) return updatedExpression; } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); @@ -535,6 +569,12 @@ when QueryableMethods.IsSumWithSelector(method): return ProcessUnknownMethod(methodCallExpression); } + /// + /// 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. + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { var operand = Visit(unaryExpression.Operand); @@ -1327,7 +1367,7 @@ private Expression ApplyQueryFilter(NavigationExpansionExpression navigationExpa { filterPredicate = queryFilter; filterPredicate = (LambdaExpression)_parameterExtractingExpressionVisitor.ExtractParameters(filterPredicate); - filterPredicate = (LambdaExpression)_queryTranslationPreprocessor.NormalizeQueryableMethodCall(filterPredicate); + filterPredicate = (LambdaExpression)_queryTranslationPreprocessor.NormalizeQueryableMethod(filterPredicate); // We need to do entity equality, but that requires a full method call on a query root to properly flow the // entity information through. Construct a MethodCall wrapper for the predicate with the proper query root. @@ -1519,7 +1559,7 @@ static bool IsNumericType(Type type) } } - protected virtual NavigationExpansionExpression CreateNavigationExpansionExpression([NotNull] Expression sourceExpression, [NotNull] IEntityType entityType) + private NavigationExpansionExpression CreateNavigationExpansionExpression([NotNull] Expression sourceExpression, [NotNull] IEntityType entityType) { var entityReference = new EntityReference(entityType); PopulateEagerLoadedNavigations(entityReference.IncludePaths); diff --git a/src/EFCore/Query/Internal/NegationOptimizingExpressionVisitor.cs b/src/EFCore/Query/Internal/NegationOptimizingExpressionVisitor.cs deleted file mode 100644 index 30dcd7f4c0b..00000000000 --- a/src/EFCore/Query/Internal/NegationOptimizingExpressionVisitor.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.EntityFrameworkCore.Utilities; - -namespace Microsoft.EntityFrameworkCore.Query.Internal -{ - public class NegationOptimizingExpressionVisitor : ExpressionVisitor - { - private static bool TryNegate(ExpressionType expressionType, out ExpressionType result) - { - var negated = expressionType switch - { - ExpressionType.AndAlso => ExpressionType.OrElse, - ExpressionType.OrElse => ExpressionType.AndAlso, - ExpressionType.Equal => ExpressionType.NotEqual, - ExpressionType.NotEqual => ExpressionType.Equal, - ExpressionType.GreaterThan => ExpressionType.LessThanOrEqual, - ExpressionType.GreaterThanOrEqual => ExpressionType.LessThan, - ExpressionType.LessThan => ExpressionType.GreaterThanOrEqual, - ExpressionType.LessThanOrEqual => ExpressionType.GreaterThan, - _ => (ExpressionType?)null - }; - - result = negated ?? default; - return negated.HasValue; - } - - private static ExpressionType Negate(ExpressionType expressionType) - => TryNegate(expressionType, out var result) ? result : throw new KeyNotFoundException(); - - protected override Expression VisitUnary(UnaryExpression unaryExpression) - { - Check.NotNull(unaryExpression, nameof(unaryExpression)); - - if (unaryExpression.NodeType == ExpressionType.Not - && unaryExpression.IsLogicalNot()) - { - if (unaryExpression.Operand is ConstantExpression innerConstant - && innerConstant.Value is bool value) - { - // !(true) -> false - // !(false) -> true - return Expression.Constant(!value); - } - - if (unaryExpression.Operand is UnaryExpression innerUnary - && innerUnary.NodeType == ExpressionType.Not) - { - // !(!a) -> a - return Visit(innerUnary.Operand); - } - - if (unaryExpression.Operand is BinaryExpression innerBinary) - { - // De Morgan's - if (innerBinary.NodeType == ExpressionType.AndAlso - || innerBinary.NodeType == ExpressionType.OrElse) - { - return Visit( - Expression.MakeBinary( - Negate(innerBinary.NodeType), - Expression.Not(innerBinary.Left), - Expression.Not(innerBinary.Right))); - } - - if (TryNegate(innerBinary.NodeType, out var negated)) - { - return Visit( - Expression.MakeBinary( - negated, - innerBinary.Left, - innerBinary.Right)); - } - } - } - - return base.VisitUnary(unaryExpression); - } - } -} diff --git a/src/EFCore/Query/Internal/NullCheckRemovingExpressionVisitor.cs b/src/EFCore/Query/Internal/NullCheckRemovingExpressionVisitor.cs index a08b8619e93..3cc7bcd804d 100644 --- a/src/EFCore/Query/Internal/NullCheckRemovingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/NullCheckRemovingExpressionVisitor.cs @@ -7,11 +7,23 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 class NullCheckRemovingExpressionVisitor : ExpressionVisitor { private readonly NullSafeAccessVerifyingExpressionVisitor _nullSafeAccessVerifyingExpressionVisitor = new NullSafeAccessVerifyingExpressionVisitor(); + /// + /// 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. + /// protected override Expression VisitConditional(ConditionalExpression conditionalExpression) { Check.NotNull(conditionalExpression, nameof(conditionalExpression)); diff --git a/src/EFCore/Query/Internal/ParameterExtractingExpressionVisitor.cs b/src/EFCore/Query/Internal/ParameterExtractingExpressionVisitor.cs index 397f96716c3..b7cd69a7c8b 100644 --- a/src/EFCore/Query/Internal/ParameterExtractingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/ParameterExtractingExpressionVisitor.cs @@ -236,6 +236,12 @@ private static bool ShortCircuitLogicalExpression(Expression expression, Express && ((constantValue && nodeType == ExpressionType.OrElse) || (!constantValue && nodeType == ExpressionType.AndAlso)); + /// + /// 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. + /// protected override Expression VisitExtension(Expression extensionExpression) { if (extensionExpression is QueryRootExpression queryRootExpression) diff --git a/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs b/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs index 71c805ccb62..fbf0b76c029 100644 --- a/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs +++ b/src/EFCore/Query/Internal/QueryCompilationContextFactory.cs @@ -8,7 +8,10 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { /// /// - /// A factory for creating instances. + /// 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. /// /// /// The service lifetime is . This means that each @@ -21,11 +24,23 @@ public class QueryCompilationContextFactory : IQueryCompilationContextFactory { private readonly QueryCompilationContextDependencies _dependencies; + /// + /// 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 QueryCompilationContextFactory([NotNull] QueryCompilationContextDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QueryCompilationContext Create(bool async) => new QueryCompilationContext(_dependencies, async); } diff --git a/src/EFCore/Query/Internal/QueryOptimizingExpressionVisitor.cs b/src/EFCore/Query/Internal/QueryOptimizingExpressionVisitor.cs index b8650b371b5..d59111e8a1d 100644 --- a/src/EFCore/Query/Internal/QueryOptimizingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/QueryOptimizingExpressionVisitor.cs @@ -9,6 +9,12 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 class QueryOptimizingExpressionVisitor : ExpressionVisitor { private static readonly MethodInfo _stringCompareWithComparisonMethod = @@ -22,6 +28,12 @@ public class QueryOptimizingExpressionVisitor : ExpressionVisitor private static readonly Expression _constantNullString = Expression.Constant(null, typeof(string)); + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); @@ -122,6 +134,12 @@ protected override Expression VisitMethodCall(MethodCallExpression methodCallExp return visited; } + /// + /// 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. + /// protected override Expression VisitUnary(UnaryExpression unaryExpression) { Check.NotNull(unaryExpression, nameof(unaryExpression)); diff --git a/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs b/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs index 9d137a897b9..41e8fb76882 100644 --- a/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs +++ b/src/EFCore/Query/Internal/QueryTranslationPostprocessorFactory.cs @@ -24,16 +24,28 @@ public class QueryTranslationPostprocessorFactory : IQueryTranslationPostprocess { private readonly QueryTranslationPostprocessorDependencies _dependencies; + /// + /// 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 QueryTranslationPostprocessorFactory([NotNull] QueryTranslationPostprocessorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QueryTranslationPostprocessor Create(QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); - return new QueryTranslationPostprocessor(_dependencies); + return new QueryTranslationPostprocessor(_dependencies, queryCompilationContext); } } } diff --git a/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs b/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs index 0ec15437e55..d71bb40d6c2 100644 --- a/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs +++ b/src/EFCore/Query/Internal/QueryTranslationPreprocessorFactory.cs @@ -9,7 +9,10 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { /// /// - /// A factory for creating instances. + /// 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. /// /// /// The service lifetime is . This means a single instance @@ -21,11 +24,23 @@ public class QueryTranslationPreprocessorFactory : IQueryTranslationPreprocessor { private readonly QueryTranslationPreprocessorDependencies _dependencies; + /// + /// 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 QueryTranslationPreprocessorFactory([NotNull] QueryTranslationPreprocessorDependencies dependencies) { _dependencies = dependencies; } + /// + /// 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 virtual QueryTranslationPreprocessor Create(QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); diff --git a/src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs b/src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs index aaea1d90ec0..af858b8f994 100644 --- a/src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs @@ -13,12 +13,24 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 class QueryableMethodNormalizingExpressionVisitor : ExpressionVisitor { private readonly QueryCompilationContext _queryCompilationContext; private readonly SelectManyVerifyingExpressionVisitor _selectManyVerifyingExpressionVisitor = new SelectManyVerifyingExpressionVisitor(); + /// + /// 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 QueryableMethodNormalizingExpressionVisitor([NotNull] QueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(Query)); @@ -26,6 +38,12 @@ public QueryableMethodNormalizingExpressionVisitor([NotNull] QueryCompilationCon _queryCompilationContext = queryCompilationContext; } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); diff --git a/src/EFCore/Query/Internal/SubqueryMemberPushdownExpressionVisitor.cs b/src/EFCore/Query/Internal/SubqueryMemberPushdownExpressionVisitor.cs index 8d3469d61e1..b9a5b24cfef 100644 --- a/src/EFCore/Query/Internal/SubqueryMemberPushdownExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/SubqueryMemberPushdownExpressionVisitor.cs @@ -12,6 +12,12 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal { + /// + /// 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 class SubqueryMemberPushdownExpressionVisitor : ExpressionVisitor { private static readonly List _supportedMethods = new List @@ -44,11 +50,23 @@ public class SubqueryMemberPushdownExpressionVisitor : ExpressionVisitor private readonly IModel _model; + /// + /// 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 SubqueryMemberPushdownExpressionVisitor([NotNull] IModel model) { _model = model; } + /// + /// 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. + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -74,6 +92,12 @@ protected override Expression VisitMember(MemberExpression memberExpression) return memberExpression.Update(innerExpression); } + /// + /// 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. + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); diff --git a/src/EFCore/Query/MaterializeCollectionNavigationExpression.cs b/src/EFCore/Query/MaterializeCollectionNavigationExpression.cs index 595830a2122..9cbf42485dd 100644 --- a/src/EFCore/Query/MaterializeCollectionNavigationExpression.cs +++ b/src/EFCore/Query/MaterializeCollectionNavigationExpression.cs @@ -9,8 +9,22 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents materialization of a collection navigation in . + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class MaterializeCollectionNavigationExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class. + /// + /// An expression reprensenting how to get value from query to create the collection. + /// A navigation associated with this collection. public MaterializeCollectionNavigationExpression([NotNull] Expression subquery, [NotNull] INavigation navigation) { Check.NotNull(subquery, nameof(subquery)); @@ -20,12 +34,21 @@ public MaterializeCollectionNavigationExpression([NotNull] Expression subquery, Navigation = navigation; } + /// + /// The expression that returns the values from query used to create the collection. + /// public virtual Expression Subquery { get; } + /// + /// The navigation associated with this collection. + /// public virtual INavigation Navigation { get; } + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// public override Type Type => Navigation.ClrType; + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -33,6 +56,12 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return Update(visitor.Visit(Subquery)); } + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual MaterializeCollectionNavigationExpression Update([NotNull] Expression subquery) { Check.NotNull(subquery, nameof(subquery)); @@ -42,6 +71,7 @@ public virtual MaterializeCollectionNavigationExpression Update([NotNull] Expres : this; } + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore/Query/ProjectionBindingExpression.cs b/src/EFCore/Query/ProjectionBindingExpression.cs index 8c7631bddd8..162fdc6af5b 100644 --- a/src/EFCore/Query/ProjectionBindingExpression.cs +++ b/src/EFCore/Query/ProjectionBindingExpression.cs @@ -11,8 +11,24 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that gets values from to be used in + /// while creating results. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class ProjectionBindingExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class. + /// + /// The query expression to get the value from. + /// The projection member to bind with query expression. + /// The clr type of value being read. public ProjectionBindingExpression( [NotNull] Expression queryExpression, [NotNull] ProjectionMember projectionMember, @@ -27,6 +43,12 @@ public ProjectionBindingExpression( Type = type; } + /// + /// Creates a new instance of the class. + /// + /// The query expression to get the value from. + /// The index to bind with query expression projection. + /// The clr type of value being read. public ProjectionBindingExpression( [NotNull] Expression queryExpression, int index, @@ -40,6 +62,11 @@ public ProjectionBindingExpression( Type = type; } + /// + /// Creates a new instance of the class. + /// + /// The query expression to get the value from. + /// The index map to bind with query expression projection for ValueBuffer. public ProjectionBindingExpression( [NotNull] Expression queryExpression, [NotNull] IDictionary indexMap) @@ -52,13 +79,28 @@ public ProjectionBindingExpression( Type = typeof(ValueBuffer); } + /// + /// The query expression to bind with. + /// public virtual Expression QueryExpression { get; } + /// + /// The projection member to bind if binding is via projection member. + /// public virtual ProjectionMember ProjectionMember { get; } + /// + /// The projection member to bind if binding is via projection index. + /// public virtual int? Index { get; } + /// + /// The projection member to bind if binding is via index map for a value buffer. + /// public virtual IDictionary IndexMap { get; } + /// public override Type Type { get; } + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// protected override Expression VisitChildren(ExpressionVisitor visitor) { Check.NotNull(visitor, nameof(visitor)); @@ -66,6 +108,7 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) return this; } + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); @@ -91,6 +134,7 @@ public virtual void Print(ExpressionPrinter expressionPrinter) } } + /// public override bool Equals(object obj) => obj != null && (ReferenceEquals(this, obj) @@ -106,6 +150,7 @@ private bool Equals(ProjectionBindingExpression projectionBindingExpression) // Using reference equality here since if we are this far, we don't need to compare this. && IndexMap == projectionBindingExpression.IndexMap; + /// public override int GetHashCode() => HashCode.Combine(QueryExpression, ProjectionMember, Index, IndexMap); } } diff --git a/src/EFCore/Query/ProjectionMember.cs b/src/EFCore/Query/ProjectionMember.cs index b3bfe64ae3f..b6f87b5c5d7 100644 --- a/src/EFCore/Query/ProjectionMember.cs +++ b/src/EFCore/Query/ProjectionMember.cs @@ -11,11 +11,23 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class representing a chain of CLR members to bind. Usually generated from successive Select calls in the query. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// [DebuggerDisplay("{ToString(), nq}")] - public class ProjectionMember + public sealed class ProjectionMember { private readonly IList _memberChain; + /// + /// Creates a new instance of the class with empty MemberInfo chain. + /// public ProjectionMember() { _memberChain = new List(); @@ -28,7 +40,12 @@ private ProjectionMember([NotNull] IList memberChain) _memberChain = memberChain; } - public virtual ProjectionMember Append([NotNull] MemberInfo member) + /// + /// Append given MemberInfo to existing chain at the end. + /// + /// The MemberInfo to append. + /// A new projection member with given member info appended to existing chain. + public ProjectionMember Append([NotNull] MemberInfo member) { Check.NotNull(member, nameof(member)); @@ -38,7 +55,12 @@ public virtual ProjectionMember Append([NotNull] MemberInfo member) return new ProjectionMember(existingChain); } - public virtual ProjectionMember Prepend([NotNull] MemberInfo member) + /// + /// Prepend given MemberInfo to existing chain at the start. + /// + /// The MemberInfo to prepend. + /// A new projection member with given member info prepended to existing chain. + public ProjectionMember Prepend([NotNull] MemberInfo member) { Check.NotNull(member, nameof(member)); @@ -48,8 +70,17 @@ public virtual ProjectionMember Prepend([NotNull] MemberInfo member) return new ProjectionMember(existingChain); } - public virtual MemberInfo Last => _memberChain.LastOrDefault(); - + /// + /// + /// The last MemberInfo in the chain of MemberInfo represented by this projection member. + /// + /// + /// This method is generally used to get last memberInfo to generate an alias for projection. + /// + /// + public MemberInfo Last => _memberChain.LastOrDefault(); + + /// public override int GetHashCode() { var hash = new HashCode(); @@ -62,6 +93,7 @@ public override int GetHashCode() return hash.ToHashCode(); } + /// public override bool Equals(object obj) => obj != null && (obj is ProjectionMember projectionMember @@ -85,6 +117,7 @@ private bool Equals(ProjectionMember other) return true; } + /// public override string ToString() => _memberChain.Any() ? string.Join(".", _memberChain.Select(mi => mi.Name)) diff --git a/src/EFCore/Query/QueryCompilationContext.cs b/src/EFCore/Query/QueryCompilationContext.cs index af6206b50c5..916af416660 100644 --- a/src/EFCore/Query/QueryCompilationContext.cs +++ b/src/EFCore/Query/QueryCompilationContext.cs @@ -14,6 +14,10 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// A query compilation context. The primary data structure representing the state/components + /// used during query compilation. + /// public class QueryCompilationContext { /// @@ -45,6 +49,11 @@ public class QueryCompilationContext private Dictionary _runtimeParameters; + /// + /// Creates a new instance of the class. + /// + /// Parameter object containing dependencies for this convention. + /// A bool value indicating whether it is for async query. public QueryCompilationContext( [NotNull] QueryCompilationContextDependencies dependencies, bool async) @@ -65,16 +74,49 @@ public QueryCompilationContext( _shapedQueryCompilingExpressionVisitorFactory = dependencies.ShapedQueryCompilingExpressionVisitorFactory; } + /// + /// A value indicating whether it is async query. + /// public virtual bool IsAsync { get; } + + /// + /// The model to use during query compilation. + /// public virtual IModel Model { get; } + /// + /// The ContextOptions to use during query compilation. + /// public virtual IDbContextOptions ContextOptions { get; } + + /// + /// A value indicating whether it is tracking query. + /// public virtual bool IsTracking { get; internal set; } + /// + /// A value indicating whether the underlying server query needs to pre-buffer all data. + /// public virtual bool IsBuffering { get; } + /// + /// A value indicating whether query filters are ignored in this query. + /// public virtual bool IgnoreQueryFilters { get; internal set; } + /// + /// The set of tags applied to this query. + /// public virtual ISet Tags { get; } = new HashSet(); + /// + /// The query logger to use during query compilation. + /// public virtual IDiagnosticsLogger Logger { get; } + /// + /// The CLR type of derived DbContext to use during query compilation. + /// public virtual Type ContextType { get; } + /// + /// Adds a tag to . + /// + /// The tag to add. public virtual void AddTag([NotNull] string tag) { Check.NotEmpty(tag, nameof(tag)); @@ -82,6 +124,12 @@ public virtual void AddTag([NotNull] string tag) Tags.Add(tag); } + /// + /// Creates the query executor func which gives results for this query. + /// + /// The result type of this query. + /// The query to generate executor for. + /// Returns which can be invoked to get results of this query. public virtual Func CreateQueryExecutor([NotNull] Expression query) { Check.NotNull(query, nameof(query)); diff --git a/src/EFCore/Query/QueryContext.cs b/src/EFCore/Query/QueryContext.cs index 420b92cdee6..537df6d21af 100644 --- a/src/EFCore/Query/QueryContext.cs +++ b/src/EFCore/Query/QueryContext.cs @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Query.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; diff --git a/src/EFCore/Query/QueryRootExpression.cs b/src/EFCore/Query/QueryRootExpression.cs index 8ab825ca709..738a1012698 100644 --- a/src/EFCore/Query/QueryRootExpression.cs +++ b/src/EFCore/Query/QueryRootExpression.cs @@ -11,10 +11,24 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that represents a query root in query expression. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class QueryRootExpression : Expression, IPrintableExpression { private readonly Type _type; + /// + /// Creates a new instance of the class with associated query provider. + /// + /// The query provider associated with this query root. + /// The entity type this query root represents. public QueryRootExpression([NotNull] IAsyncQueryProvider asyncQueryProvider, [NotNull] IEntityType entityType) { Check.NotNull(asyncQueryProvider, nameof(asyncQueryProvider)); @@ -25,6 +39,10 @@ public QueryRootExpression([NotNull] IAsyncQueryProvider asyncQueryProvider, [No _type = typeof(IQueryable<>).MakeGenericType(entityType.ClrType); } + /// + /// Creates a new instance of the class without any query provider. + /// + /// The entity type this query root represents. public QueryRootExpression([NotNull] IEntityType entityType) { Check.NotNull(entityType, nameof(entityType)); @@ -34,15 +52,31 @@ public QueryRootExpression([NotNull] IEntityType entityType) _type = typeof(IQueryable<>).MakeGenericType(entityType.ClrType); } + /// + /// The query provider associated with this query root. + /// public virtual IAsyncQueryProvider QueryProvider { get; } + + /// + /// The entity type reprenseted by this query root. + /// public virtual IEntityType EntityType { get; } + /// + /// Detaches the associated query provider from this query root expression. + /// + /// A new query root expression without query provider. public virtual Expression DetachQueryProvider() => new QueryRootExpression(EntityType); + /// public override ExpressionType NodeType => ExpressionType.Extension; + /// public override Type Type => _type; + /// public override bool CanReduce => false; + /// protected override Expression VisitChildren(ExpressionVisitor visitor) => this; + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); @@ -57,12 +91,14 @@ public virtual void Print(ExpressionPrinter expressionPrinter) } } + /// public override bool Equals(object obj) => obj != null && (ReferenceEquals(this, obj) || obj is QueryRootExpression queryRootExpression && EntityType == queryRootExpression.EntityType); + /// public override int GetHashCode() => EntityType.GetHashCode(); } } diff --git a/src/EFCore/Query/QueryTranslationPostprocessor.cs b/src/EFCore/Query/QueryTranslationPostprocessor.cs index d178108aa8f..79179b587fa 100644 --- a/src/EFCore/Query/QueryTranslationPostprocessor.cs +++ b/src/EFCore/Query/QueryTranslationPostprocessor.cs @@ -7,17 +7,48 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class that postprocesses the translated query. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class QueryTranslationPostprocessor { - public QueryTranslationPostprocessor([NotNull] QueryTranslationPostprocessorDependencies dependencies) + /// + /// Creates a new instance of the class. + /// + /// Parameter object containing dependencies for this class. + /// The query compilation context object to use. + public QueryTranslationPostprocessor( + [NotNull] QueryTranslationPostprocessorDependencies dependencies, + [NotNull] QueryCompilationContext queryCompilationContext) { Check.NotNull(dependencies, nameof(dependencies)); + Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Dependencies = dependencies; + QueryCompilationContext = queryCompilationContext; } + /// + /// Parameter object containing service dependencies. + /// protected virtual QueryTranslationPostprocessorDependencies Dependencies { get; } + /// + /// The query compilation context object for current compilation. + /// + protected virtual QueryCompilationContext QueryCompilationContext { get; } + + /// + /// Applies postprocessing transformations to the translated query. + /// + /// The query to process. + /// A query expression after transformations. public virtual Expression Process([NotNull] Expression query) { Check.NotNull(query, nameof(query)); diff --git a/src/EFCore/Query/QueryTranslationPreprocessor.cs b/src/EFCore/Query/QueryTranslationPreprocessor.cs index 52c52836a1a..b372ad95d72 100644 --- a/src/EFCore/Query/QueryTranslationPreprocessor.cs +++ b/src/EFCore/Query/QueryTranslationPreprocessor.cs @@ -8,8 +8,22 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class that preprocesses the query before translation. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class QueryTranslationPreprocessor { + /// + /// Creates a new instance of the class. + /// + /// Parameter object containing dependencies for this class. + /// The query compilation context object to use. public QueryTranslationPreprocessor( [NotNull] QueryTranslationPreprocessorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext) @@ -21,16 +35,27 @@ public QueryTranslationPreprocessor( QueryCompilationContext = queryCompilationContext; } + /// + /// Parameter object containing service dependencies. + /// protected virtual QueryTranslationPreprocessorDependencies Dependencies { get; } + /// + /// The query compilation context object for current compilation. + /// protected virtual QueryCompilationContext QueryCompilationContext { get; } + /// + /// Applies preprocessing transformations to the query. + /// + /// The query to process. + /// A query expression after transformations. public virtual Expression Process([NotNull] Expression query) { Check.NotNull(query, nameof(query)); query = new InvocationExpressionRemovingExpressionVisitor().Visit(query); - query = NormalizeQueryableMethodCall(query); + query = NormalizeQueryableMethod(query); query = new NullCheckRemovingExpressionVisitor().Visit(query); query = new SubqueryMemberPushdownExpressionVisitor(QueryCompilationContext.Model).Visit(query); query = new NavigationExpandingExpressionVisitor(this, QueryCompilationContext, Dependencies.EvaluatableExpressionFilter) @@ -40,7 +65,12 @@ public virtual Expression Process([NotNull] Expression query) return query; } - public virtual Expression NormalizeQueryableMethodCall([NotNull] Expression expression) + /// + /// Normalizes queryable methods in the query. + /// + /// The query expression to normalize. + /// A query expression after normalization has been done. + public virtual Expression NormalizeQueryableMethod([NotNull] Expression expression) => new QueryableMethodNormalizingExpressionVisitor(QueryCompilationContext) .Visit(Check.NotNull(expression, nameof(expression))); } diff --git a/src/EFCore/Query/QueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore/Query/QueryableMethodTranslatingExpressionVisitor.cs index 25086603865..e0ecbf9844d 100644 --- a/src/EFCore/Query/QueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore/Query/QueryableMethodTranslatingExpressionVisitor.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -14,24 +15,51 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class that translates queryable methods in a query. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public abstract class QueryableMethodTranslatingExpressionVisitor : ExpressionVisitor { private readonly bool _subquery; private readonly EntityShaperNullableMarkingExpressionVisitor _entityShaperNullableMarkingExpressionVisitor; + /// + /// Creates a new instance of the class. + /// + /// Parameter object containing dependencies for this class. + /// The query compilation context object to use. + /// A bool value indicating whether it is for a subquery translation. protected QueryableMethodTranslatingExpressionVisitor( [NotNull] QueryableMethodTranslatingExpressionVisitorDependencies dependencies, + [NotNull] QueryCompilationContext queryCompilationContext, bool subquery) { Check.NotNull(dependencies, nameof(dependencies)); + Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Dependencies = dependencies; + QueryCompilationContext = queryCompilationContext; _subquery = subquery; _entityShaperNullableMarkingExpressionVisitor = new EntityShaperNullableMarkingExpressionVisitor(); } + /// + /// Parameter object containing service dependencies. + /// protected virtual QueryableMethodTranslatingExpressionVisitorDependencies Dependencies { get; } + /// + /// The query compilation context object for current compilation. + /// + protected virtual QueryCompilationContext QueryCompilationContext { get; } + + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -44,6 +72,7 @@ protected override Expression VisitExtension(Expression extensionExpression) }; } + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); @@ -451,6 +480,11 @@ protected override Expression VisitExtension(Expression extensionExpression) } } + /// + /// Marks the entity shaper in the given shaper expression as nullable. + /// + /// The shaper expression to process. + /// New shaper expression in which all entity shapers are nullable. protected virtual Expression MarkShaperNullable([NotNull] Expression shaperExpression) { Check.NotNull(shaperExpression, nameof(shaperExpression)); @@ -458,15 +492,24 @@ protected virtual Expression MarkShaperNullable([NotNull] Expression shaperExpre return _entityShaperNullableMarkingExpressionVisitor.Visit(shaperExpression); } + /// + /// Translates the result selector for join operation. + /// + /// The shaped query expression for outer source. The join on the query expression is already performed on outer query expression. + /// The result selector lambda to translate. + /// The shaper for inner source. + /// The clr type of transparent identifier created from result. + /// The shaped query expression after translation of result selector. protected virtual ShapedQueryExpression TranslateResultSelectorForJoin( [NotNull] ShapedQueryExpression outer, [NotNull] LambdaExpression resultSelector, [NotNull] Expression innerShaper, - [CanBeNull] Type transparentIdentifierType) + [NotNull] Type transparentIdentifierType) { Check.NotNull(outer, nameof(outer)); Check.NotNull(resultSelector, nameof(resultSelector)); Check.NotNull(innerShaper, nameof(innerShaper)); + Check.NotNull(transparentIdentifierType, nameof(transparentIdentifierType)); outer = outer.UpdateShaperExpression( CombineShapers(outer.QueryExpression, outer.ShaperExpression, innerShaper, transparentIdentifierType)); @@ -544,6 +587,11 @@ private static Expression AccessInnerTransparentField( return Expression.Field(targetExpression, fieldInfo); } + /// + /// Translates the given subquery. + /// + /// The subquery expression to translate. + /// The translation of the given subquery. public virtual ShapedQueryExpression TranslateSubquery([NotNull] Expression expression) { Check.NotNull(expression, nameof(expression)); @@ -551,46 +599,158 @@ public virtual ShapedQueryExpression TranslateSubquery([NotNull] Expression expr return (ShapedQueryExpression)CreateSubqueryVisitor().Visit(expression); } + /// + /// Creates a visitor customized to translate a subquery through . + /// + /// A visitor to translate subquery. protected abstract QueryableMethodTranslatingExpressionVisitor CreateSubqueryVisitor(); + /// + /// Creates a for the given type by finding its entity type in the model. + /// + /// The clr type of the entity type to look for. + /// A shaped query expression for the given clr type. [Obsolete("Use overload which takes IEntityType.")] protected abstract ShapedQueryExpression CreateShapedQueryExpression([NotNull] Type elementType); + /// + /// Creates a for the given entity type. + /// + /// The the entity type. + /// A shaped query expression for the given entity type. protected abstract ShapedQueryExpression CreateShapedQueryExpression([NotNull] IEntityType entityType); + + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateAll([NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression predicate); - protected abstract ShapedQueryExpression TranslateAny([NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression predicate); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. + protected abstract ShapedQueryExpression TranslateAny([NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate); + + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The result type after the operation. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateAverage( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression selector, [NotNull] Type resultType); - protected abstract ShapedQueryExpression TranslateCast([NotNull] ShapedQueryExpression source, [NotNull] Type resultType); - + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The type result is being casted to. + /// The shaped query after translation. + protected abstract ShapedQueryExpression TranslateCast([NotNull] ShapedQueryExpression source, [NotNull] Type castType); + + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The other source to perform concat. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateConcat( [NotNull] ShapedQueryExpression source1, [NotNull] ShapedQueryExpression source2); + + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The item to search for. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateContains([NotNull] ShapedQueryExpression source, [NotNull] Expression item); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateCount( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The default value to use. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateDefaultIfEmpty( [NotNull] ShapedQueryExpression source, [CanBeNull] Expression defaultValue); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateDistinct([NotNull] ShapedQueryExpression source); + /// + /// Translates method or + /// over the given source. + /// + /// The shaped query on which the operator is applied. + /// The index of the element. + /// A value indicating whether default should be returned or throw. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateElementAtOrDefault( [NotNull] ShapedQueryExpression source, [NotNull] Expression index, bool returnDefault); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The other source to perform except with. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateExcept( [NotNull] ShapedQueryExpression source1, [NotNull] ShapedQueryExpression source2); + /// + /// Translates method or + /// and their other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The return type of result. + /// A value indicating whether default should be returned or throw. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateFirstOrDefault( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate, [NotNull] Type returnType, bool returnDefault); + /// + /// Translates method and + /// other overlods over the given source. + /// + /// The shaped query on which the operator is applied. + /// The key selector supplied in the call. + /// The element selector supplied in the call. + /// The result selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateGroupBy( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression keySelector, [CanBeNull] LambdaExpression elementSelector, [CanBeNull] LambdaExpression resultSelector); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The inner shaped query to perform join with. + /// The key selector for the outer source. + /// The key selector for the inner source. + /// The result selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateGroupJoin( [NotNull] ShapedQueryExpression outer, [NotNull] ShapedQueryExpression inner, @@ -598,9 +758,24 @@ protected abstract ShapedQueryExpression TranslateGroupJoin( [NotNull] LambdaExpression innerKeySelector, [NotNull] LambdaExpression resultSelector); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The other source to perform intersect with. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateIntersect( [NotNull] ShapedQueryExpression source1, [NotNull] ShapedQueryExpression source2); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The inner shaped query to perform join with. + /// The key selector for the outer source. + /// The key selector for the inner source. + /// The result selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateJoin( [NotNull] ShapedQueryExpression outer, [NotNull] ShapedQueryExpression inner, @@ -608,6 +783,21 @@ protected abstract ShapedQueryExpression TranslateJoin( [CanBeNull] LambdaExpression innerKeySelector, [NotNull] LambdaExpression resultSelector); + /// + /// + /// Translates LeftJoin over the given source. + /// + /// + /// Certain patterns of GroupJoin-DefaultIfEmpty-SelectMany represents a left join in database. We identify such pattern + /// in advance and convert it to join like syntax. + /// + /// + /// The shaped query on which the operator is applied. + /// The inner shaped query to perform join with. + /// The key selector for the outer source. + /// The key selector for the inner source. + /// The result selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateLeftJoin( [NotNull] ShapedQueryExpression outer, [NotNull] ShapedQueryExpression inner, @@ -615,57 +805,187 @@ protected abstract ShapedQueryExpression TranslateLeftJoin( [CanBeNull] LambdaExpression innerKeySelector, [NotNull] LambdaExpression resultSelector); + /// + /// Translates method or + /// and their other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The return type of result. + /// A value indicating whether default should be returned or throw. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateLastOrDefault( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate, [NotNull] Type returnType, bool returnDefault); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateLongCount( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The result type after the operation. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateMax( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression selector, [NotNull] Type resultType); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The result type after the operation. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateMin( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression selector, [NotNull] Type resultType); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The type of result which is being filtered with. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateOfType([NotNull] ShapedQueryExpression source, [NotNull] Type resultType); + /// + /// Translates or + /// method + /// over the given source. + /// + /// The shaped query on which the operator is applied. + /// The key selector supplied in the call. + /// A value indicating whether the ordering is ascending or not. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateOrderBy( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression keySelector, bool ascending); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateReverse([NotNull] ShapedQueryExpression source); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSelect( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression selector); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The collection selector supplied in the call. + /// The result selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSelectMany( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression collectionSelector, [NotNull] LambdaExpression resultSelector); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSelectMany( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression selector); + /// + /// Translates method or + /// and their other + /// overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The return type of result. + /// A value indicating whether default should be returned or throw. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSingleOrDefault( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression predicate, [NotNull] Type returnType, bool returnDefault); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The count supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSkip( [NotNull] ShapedQueryExpression source, [NotNull] Expression count); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSkipWhile( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression predicate); + /// + /// Translates method and other overloads over the given source. + /// + /// The shaped query on which the operator is applied. + /// The selector supplied in the call. + /// The result type after the operation. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateSum( [NotNull] ShapedQueryExpression source, [CanBeNull] LambdaExpression selector, [NotNull] Type resultType); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The count supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateTake([NotNull] ShapedQueryExpression source, [NotNull] Expression count); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateTakeWhile( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression predicate); + /// + /// Translates or + /// method + /// over the given source. + /// + /// The shaped query on which the operator is applied. + /// The key selector supplied in the call. + /// A value indicating whether the ordering is ascending or not. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateThenBy( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression keySelector, bool ascending); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The other source to perform union with. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateUnion( [NotNull] ShapedQueryExpression source1, [NotNull] ShapedQueryExpression source2); + /// + /// Translates method over the given source. + /// + /// The shaped query on which the operator is applied. + /// The predicate supplied in the call. + /// The shaped query after translation. protected abstract ShapedQueryExpression TranslateWhere( [NotNull] ShapedQueryExpression source, [NotNull] LambdaExpression predicate); } diff --git a/src/EFCore/Query/ReplacingExpressionVisitor.cs b/src/EFCore/Query/ReplacingExpressionVisitor.cs index c47e63f8a4b..81abae85b44 100644 --- a/src/EFCore/Query/ReplacingExpressionVisitor.cs +++ b/src/EFCore/Query/ReplacingExpressionVisitor.cs @@ -10,11 +10,27 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression visitor that replaces one expression with another in given expression tree. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class ReplacingExpressionVisitor : ExpressionVisitor { private readonly Expression[] _originals; private readonly Expression[] _replacements; + /// + /// Replaces one expression with another in given expression tree. + /// + /// The expression to replace. + /// The expression to be used as replacement. + /// The expression tree in which replacement is going to be performed. + /// An expression tree with replacements made. public static Expression Replace([NotNull] Expression original, [NotNull] Expression replacement, [NotNull] Expression tree) { Check.NotNull(original, nameof(original)); @@ -24,6 +40,11 @@ public static Expression Replace([NotNull] Expression original, [NotNull] Expres return new ReplacingExpressionVisitor(new[] { original }, new[] { replacement }).Visit(tree); } + /// + /// Creates a new instance of the class. + /// + /// An array of original expressions to replace. + /// An array of expressions to be used as replacements. public ReplacingExpressionVisitor([NotNull] Expression[] originals, [NotNull] Expression[] replacements) { Check.NotNull(originals, nameof(originals)); @@ -33,6 +54,7 @@ public ReplacingExpressionVisitor([NotNull] Expression[] originals, [NotNull] Ex _replacements = replacements; } + /// public override Expression Visit(Expression expression) { if (expression == null) @@ -53,6 +75,7 @@ public override Expression Visit(Expression expression) return base.Visit(expression); } + /// protected override Expression VisitMember(MemberExpression memberExpression) { Check.NotNull(memberExpression, nameof(memberExpression)); @@ -85,6 +108,7 @@ protected override Expression VisitMember(MemberExpression memberExpression) return memberExpression.Update(innerExpression); } + /// protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression) { Check.NotNull(methodCallExpression, nameof(methodCallExpression)); diff --git a/src/EFCore/Query/ResultCardinality.cs b/src/EFCore/Query/ResultCardinality.cs index daac39ab443..390265fb7ab 100644 --- a/src/EFCore/Query/ResultCardinality.cs +++ b/src/EFCore/Query/ResultCardinality.cs @@ -3,12 +3,30 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An enum that represents the cardinality of query result. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public enum ResultCardinality { -#pragma warning disable SA1602 // Enumeration items should be documented + /// + /// Indicates that the query returns multiple results. + /// Enumerable, + + /// + /// Indicates that the query returns a single result. Throws if there is no result or more than one result. + /// Single, + + /// + /// Indicates that the query returns a single or default result. Throws if there is more than one result. + /// SingleOrDefault -#pragma warning restore SA1602 // Enumeration items should be documented } } diff --git a/src/EFCore/Query/ShapedQueryCompilingExpressionVisitor.cs b/src/EFCore/Query/ShapedQueryCompilingExpressionVisitor.cs index 3c92d312274..a11eea7944a 100644 --- a/src/EFCore/Query/ShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore/Query/ShapedQueryCompilingExpressionVisitor.cs @@ -20,6 +20,15 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A class that compiles the shaper expression for given shaped query expression. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public abstract class ShapedQueryCompilingExpressionVisitor : ExpressionVisitor { private static readonly PropertyInfo _cancellationTokenMemberInfo @@ -29,6 +38,11 @@ private static readonly PropertyInfo _cancellationTokenMemberInfo private readonly EntityMaterializerInjectingExpressionVisitor _entityMaterializerInjectingExpressionVisitor; private readonly ConstantVerifyingExpressionVisitor _constantVerifyingExpressionVisitor; + /// + /// Creates a new instance of the class. + /// + /// Parameter object containing dependencies for this class. + /// The query compilation context object to use. protected ShapedQueryCompilingExpressionVisitor( [NotNull] ShapedQueryCompilingExpressionVisitorDependencies dependencies, [NotNull] QueryCompilationContext queryCompilationContext) @@ -37,7 +51,7 @@ protected ShapedQueryCompilingExpressionVisitor( Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Dependencies = dependencies; - IsTracking = queryCompilationContext.IsTracking; + QueryCompilationContext = queryCompilationContext; _entityMaterializerInjectingExpressionVisitor = new EntityMaterializerInjectingExpressionVisitor( @@ -46,9 +60,6 @@ protected ShapedQueryCompilingExpressionVisitor( _constantVerifyingExpressionVisitor = new ConstantVerifyingExpressionVisitor(dependencies.TypeMappingSource); - IsBuffering = queryCompilationContext.IsBuffering; - IsAsync = queryCompilationContext.IsAsync; - if (queryCompilationContext.IsAsync) { _cancellationTokenParameter = Expression.MakeMemberAccess( @@ -57,14 +68,17 @@ protected ShapedQueryCompilingExpressionVisitor( } } + /// + /// Parameter object containing service dependencies. + /// protected virtual ShapedQueryCompilingExpressionVisitorDependencies Dependencies { get; } - protected virtual bool IsTracking { get; } - - public virtual bool IsBuffering { get; internal set; } - - protected virtual bool IsAsync { get; } + /// + /// The query compilation context object for current compilation. + /// + protected virtual QueryCompilationContext QueryCompilationContext { get; } + /// protected override Expression VisitExtension(Expression extensionExpression) { Check.NotNull(extensionExpression, nameof(extensionExpression)); @@ -78,7 +92,7 @@ protected override Expression VisitExtension(Expression extensionExpression) return serverEnumerable; case ResultCardinality.Single: - return IsAsync + return QueryCompilationContext.IsAsync ? Expression.Call( _singleAsyncMethodInfo.MakeGenericMethod(serverEnumerable.Type.TryGetSequenceType()), serverEnumerable, @@ -88,7 +102,7 @@ protected override Expression VisitExtension(Expression extensionExpression) serverEnumerable); case ResultCardinality.SingleOrDefault: - return IsAsync + return QueryCompilationContext.IsAsync ? Expression.Call( _singleOrDefaultAsyncMethodInfo.MakeGenericMethod(serverEnumerable.Type.TryGetSequenceType()), serverEnumerable, @@ -153,8 +167,20 @@ private static async Task SingleOrDefaultAsync( return result; } + + /// + /// Visits given shaped query expression to create an expression of enumerable. + /// + /// The shaped query expression to compile. + /// An expression of enumerable. protected abstract Expression VisitShapedQuery([NotNull] ShapedQueryExpression shapedQueryExpression); + /// + /// Inject entity materializers in given shaper expression. is replaced with materializer + /// expression for given entity. + /// + /// The expression to inject entity materializers. + /// A expression with entity materializers injected. protected virtual Expression InjectEntityMaterializers([NotNull] Expression expression) { Check.NotNull(expression, nameof(expression)); diff --git a/src/EFCore/Query/ShapedQueryExpression.cs b/src/EFCore/Query/ShapedQueryExpression.cs index 3f0d1a5afb3..8f9e890f816 100644 --- a/src/EFCore/Query/ShapedQueryExpression.cs +++ b/src/EFCore/Query/ShapedQueryExpression.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using JetBrains.Annotations; @@ -10,8 +11,22 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// An expression that combines a query expression and shaper expression. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public class ShapedQueryExpression : Expression, IPrintableExpression { + /// + /// Creates a new instance of the class with associated query provider. + /// + /// The query expression to get results from server. + /// The shaper expression to create result objects from server results. public ShapedQueryExpression([NotNull] Expression queryExpression, [NotNull] Expression shaperExpression) : this(Check.NotNull(queryExpression, nameof(queryExpression)), Check.NotNull(shaperExpression, nameof(shaperExpression)), @@ -27,21 +42,40 @@ private ShapedQueryExpression( ResultCardinality = resultCardinality; } + /// + /// An expression representing the query to be run against server to retrieve the data. + /// public virtual Expression QueryExpression { get; } + /// + /// The cardinality of the results generated. + /// public virtual ResultCardinality ResultCardinality { get; } + /// + /// An expression representing the shaper to be run on the results fetched from the server. + /// public virtual Expression ShaperExpression { get; } + /// public override Type Type => ResultCardinality == ResultCardinality.Enumerable - ? typeof(IQueryable<>).MakeGenericType(ShaperExpression.Type) + ? typeof(IEnumerable<>).MakeGenericType(ShaperExpression.Type) : ShaperExpression.Type; + /// public sealed override ExpressionType NodeType => ExpressionType.Extension; + /// protected override Expression VisitChildren(ExpressionVisitor visitor) => throw new InvalidOperationException(CoreStrings.VisitIsNotAllowed($"{nameof(ShapedQueryExpression)}.{nameof(VisitChildren)}")); + /// + /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will + /// return this expression. + /// + /// The property of the result. + /// The property of the result. + /// This expression if no children changed, or an expression with the updated children. public virtual ShapedQueryExpression Update([NotNull] Expression queryExpression, [NotNull] Expression shaperExpression) { Check.NotNull(queryExpression, nameof(queryExpression)); @@ -52,6 +86,12 @@ public virtual ShapedQueryExpression Update([NotNull] Expression queryExpression : this; } + /// + /// Creates a new expression that is like this one, but using the supplied shaper expression. If shaper expression is the same, it will + /// return this expression. + /// + /// The property of the result. + /// This expression if shaper expression did not change, or an expression with the updated shaper expression. public virtual ShapedQueryExpression UpdateShaperExpression([NotNull] Expression shaperExpression) { Check.NotNull(shaperExpression, nameof(shaperExpression)); @@ -61,9 +101,15 @@ public virtual ShapedQueryExpression UpdateShaperExpression([NotNull] Expression : this; } + /// + /// Creates a new expression that is like this one, but with supplied result cardinality. + /// + /// The property of the result. + /// An expression with the updated result cardinality. public virtual ShapedQueryExpression UpdateResultCardinality(ResultCardinality resultCardinality) => new ShapedQueryExpression(QueryExpression, ShaperExpression, resultCardinality); + /// public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); diff --git a/src/EFCore/Query/TransparentIdentifierFactory.cs b/src/EFCore/Query/TransparentIdentifierFactory.cs index 1de6d78bd80..782ad65cee9 100644 --- a/src/EFCore/Query/TransparentIdentifierFactory.cs +++ b/src/EFCore/Query/TransparentIdentifierFactory.cs @@ -7,8 +7,23 @@ namespace Microsoft.EntityFrameworkCore.Query { + /// + /// + /// A factory to create transparent identifier to create during query processing. + /// + /// + /// This type is typically used by database providers (and other extensions). It is generally + /// not used in application code. + /// + /// public static class TransparentIdentifierFactory { + /// + /// Creates new transparent identifier type for given types. + /// + /// The outer type of the transparent identifier. + /// The inner type of the transparent identifier. + /// The created transparent identifier type. public static Type Create([NotNull] Type outerType, [NotNull] Type innerType) { Check.NotNull(outerType, nameof(outerType)); @@ -20,9 +35,7 @@ public static Type Create([NotNull] Type outerType, [NotNull] Type innerType) private readonly struct TransparentIdentifier { [UsedImplicitly] -#pragma warning disable IDE0051 // Remove unused private members public TransparentIdentifier(TOuter outer, TInner inner) -#pragma warning restore IDE0051 // Remove unused private members { Outer = outer; Inner = inner; diff --git a/src/EFCore/Storage/Database.cs b/src/EFCore/Storage/Database.cs index 90b4ef8eced..5ba1d59e81f 100644 --- a/src/EFCore/Storage/Database.cs +++ b/src/EFCore/Storage/Database.cs @@ -67,6 +67,7 @@ public abstract Task SaveChangesAsync( IList entries, CancellationToken cancellationToken = default); + /// public virtual Func CompileQuery(Expression query, bool async) => Dependencies.QueryCompilationContextFactory .Create(async) diff --git a/src/EFCore/Storage/IDatabase.cs b/src/EFCore/Storage/IDatabase.cs index d95f027cec2..88fa8b27d54 100644 --- a/src/EFCore/Storage/IDatabase.cs +++ b/src/EFCore/Storage/IDatabase.cs @@ -50,6 +50,13 @@ Task SaveChangesAsync( [NotNull] IList entries, CancellationToken cancellationToken = default); + /// + /// Compiles the given query to generate a . + /// + /// The type of query result. + /// The query to compile. + /// A value indicating whether this is an async query. + /// A which can be invoked to get results of the query. Func CompileQuery([NotNull] Expression query, bool async); } } diff --git a/src/EFCore/Query/QueryableMethods.cs b/src/Shared/QueryableMethods.cs similarity index 99% rename from src/EFCore/Query/QueryableMethods.cs rename to src/Shared/QueryableMethods.cs index 54344159548..7860bed4e8e 100644 --- a/src/EFCore/Query/QueryableMethods.cs +++ b/src/Shared/QueryableMethods.cs @@ -14,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Query /// /// A class that provides reflection metadata for translatable LINQ methods. /// - public static class QueryableMethods + internal static class QueryableMethods { public static MethodInfo AsQueryable { get; } public static MethodInfo Cast { get; } diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 15da800c640..c9bbd9d3d33 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,7 +2,7 @@ - $(NoWarn);xUnit1003;xUnit1010;xUnit1013 + $(NoWarn);1591;xUnit1003;xUnit1010;xUnit1013 diff --git a/test/EFCore.Tests/DbContextServicesTest.cs b/test/EFCore.Tests/DbContextServicesTest.cs index dd0ce1a5fbb..fd9ac2e2de5 100644 --- a/test/EFCore.Tests/DbContextServicesTest.cs +++ b/test/EFCore.Tests/DbContextServicesTest.cs @@ -16,6 +16,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Query; +using Microsoft.EntityFrameworkCore.Query.Internal; using Microsoft.EntityFrameworkCore.TestUtilities; using Microsoft.EntityFrameworkCore.ValueGeneration; using Microsoft.Extensions.Caching.Memory; diff --git a/test/EFCore.Tests/Metadata/Internal/EntityMaterializerSourceTest.cs b/test/EFCore.Tests/Metadata/Internal/EntityMaterializerSourceTest.cs index 117de4923ea..89e1ed39485 100644 --- a/test/EFCore.Tests/Metadata/Internal/EntityMaterializerSourceTest.cs +++ b/test/EFCore.Tests/Metadata/Internal/EntityMaterializerSourceTest.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Query; +using Microsoft.EntityFrameworkCore.Query.Internal; using Microsoft.EntityFrameworkCore.Storage; using Xunit; diff --git a/test/EFCore.Tests/Query/EntityMaterializerSourceDependenciesTest.cs b/test/EFCore.Tests/Query/EntityMaterializerSourceDependenciesTest.cs index 2ab71c9f696..45a4944baab 100644 --- a/test/EFCore.Tests/Query/EntityMaterializerSourceDependenciesTest.cs +++ b/test/EFCore.Tests/Query/EntityMaterializerSourceDependenciesTest.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit; -namespace Microsoft.EntityFrameworkCore.Query +namespace Microsoft.EntityFrameworkCore.Query.Internal { public class EntityMaterializerSourceDependenciesTest {