From a3a06cf3ee984bdbb2c9a7e0f3a943c7c57cc9a0 Mon Sep 17 00:00:00 2001 From: AndriySvyryd Date: Sun, 15 Aug 2021 09:17:51 -0700 Subject: [PATCH] React to PR feedback --- .../Query/Internal/InExpression.cs | 2 +- .../Query/SqlExpressions/InExpression.cs | 4 +- src/EFCore/ModelConfigurationBuilder.cs | 82 +++++++++++++++++-- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/src/EFCore.Cosmos/Query/Internal/InExpression.cs b/src/EFCore.Cosmos/Query/Internal/InExpression.cs index 6912c28b612..8808a75ae1a 100644 --- a/src/EFCore.Cosmos/Query/Internal/InExpression.cs +++ b/src/EFCore.Cosmos/Query/Internal/InExpression.cs @@ -26,7 +26,7 @@ public InExpression( SqlExpression item, bool negated, SqlExpression values, - CoreTypeMapping? typeMapping) + CoreTypeMapping typeMapping) : base(typeof(bool), typeMapping) { Item = item; diff --git a/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs b/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs index c864161fde4..1be63a46b80 100644 --- a/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs +++ b/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs @@ -66,7 +66,7 @@ public InExpression( SqlExpression item, SelectExpression subquery, bool negated, - RelationalTypeMapping? typeMapping) + RelationalTypeMapping typeMapping) : this(Check.NotNull(item, nameof(item)), null, Check.NotNull(subquery, nameof(subquery)), negated, typeMapping) { } @@ -82,7 +82,7 @@ public InExpression( SqlExpression item, SqlExpression values, bool negated, - RelationalTypeMapping? typeMapping) + RelationalTypeMapping typeMapping) : this(Check.NotNull(item, nameof(item)), Check.NotNull(values, nameof(values)), null, negated, typeMapping) { } diff --git a/src/EFCore/ModelConfigurationBuilder.cs b/src/EFCore/ModelConfigurationBuilder.cs index 80ea23bba34..91000a8c312 100644 --- a/src/EFCore/ModelConfigurationBuilder.cs +++ b/src/EFCore/ModelConfigurationBuilder.cs @@ -74,7 +74,12 @@ public virtual ModelConfigurationBuilder IgnoreAny(Type type) } /// - /// Marks the given and derived types as corresponding to entity type properties. + /// + /// Marks the given and derived types as corresponding to entity type properties. + /// + /// + /// This can also be called on an interface to apply the configuration to all properties of implementing types. + /// /// /// The property type to be configured. /// An object that can be used to configure the properties. @@ -86,7 +91,12 @@ public virtual PropertiesConfigurationBuilder Properties() } /// - /// Marks the given and derived types as corresponding to entity type properties. + /// + /// Marks the given and derived types as corresponding to entity type properties. + /// + /// + /// This can also be called on an interface to apply the configuration to all properties of implementing types. + /// /// /// The property type to be configured. /// An action that performs configuration of the property. @@ -105,7 +115,13 @@ public virtual ModelConfigurationBuilder Properties( } /// - /// Marks the given and derived types as corresponding to entity type properties. + /// + /// Marks the given and derived types as corresponding to entity type properties. + /// + /// + /// This can also be called on an interface or an unbound generic type to apply the configuration to all + /// properties of implementing and constructed types. + /// /// /// The property type to be configured. /// An object that can be used to configure the property. @@ -119,7 +135,13 @@ public virtual PropertiesConfigurationBuilder Properties(Type propertyType) } /// - /// Marks the given and derived types as corresponding to entity type properties. + /// + /// Marks the given and derived types as corresponding to entity type properties. + /// + /// + /// This can also be called on an interface or an unbound generic type to apply the configuration to all + /// properties of implementing and constructed types. + /// /// /// The property type to be configured. /// An action that performs configuration of the property. @@ -140,7 +162,18 @@ public virtual ModelConfigurationBuilder Properties( } /// - /// Marks the given type as a scalar, even when used outside of entity types. + /// + /// Marks the given type as a scalar, even when used outside of entity types. This allows values of this type + /// to be used in queries that are not referencing property of this type. + /// + /// + /// Unlike this method should only be called on a non-nullable concrete type. + /// Calling it on a base type will not apply the configuration to the derived types. + /// + /// + /// Calling this is rarely needed. If there are properties of the given type calling + /// should be enough in most cases. + /// /// /// The scalar type to be configured. /// An object that can be used to configure the scalars. @@ -152,7 +185,18 @@ public virtual ScalarConfigurationBuilder Scalars() } /// - /// Marks the given type as a scalar, even when used outside of entity types. + /// + /// Marks the given type as a scalar, even when used outside of entity types. This allows values of this type + /// to be used in queries that are not referencing property of this type. + /// + /// + /// Unlike this method should only be called on a non-nullable concrete type. + /// Calling it on a base type will not apply the configuration to the derived types. + /// + /// + /// Calling this is rarely needed. If there are properties of the given type calling + /// should be enough in most cases. + /// /// /// The scalar type to be configured. /// An action that performs configuration for the scalars. @@ -171,7 +215,18 @@ public virtual ModelConfigurationBuilder Scalars( } /// - /// Marks the given type as a scalar, even when used outside of entity types. + /// + /// Marks the given type as a scalar, even when used outside of entity types. This allows values of this type + /// to be used in queries that are not referencing property of this type. + /// + /// + /// Unlike this method should only be called on a non-nullable concrete type. + /// Calling it on a base type will not apply the configuration to the derived types. + /// + /// + /// Calling this is rarely needed. If there are properties of the given type calling + /// should be enough in most cases. + /// /// /// The scalar type to be configured. /// An object that can be used to configure the scalars. @@ -185,7 +240,18 @@ public virtual ScalarConfigurationBuilder Scalars(Type scalarType) } /// - /// Marks the given type as a scalar, even when used outside of entity types. + /// + /// Marks the given type as a scalar, even when used outside of entity types. This allows values of this type + /// to be used in queries that are not referencing property of this type. + /// + /// + /// Unlike this method should only be called on a non-nullable concrete type. + /// Calling it on a base type will not apply the configuration to the derived types. + /// + /// + /// Calling this is rarely needed. If there are properties of the given type calling + /// should be enough in most cases. + /// /// /// The scalar type to be configured. /// An action that performs configuration for the scalars.