ModelConfigurationBuilder.DefaultTypeMapping Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DefaultTypeMapping(Type) |
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. |
DefaultTypeMapping(Type, Action<TypeMappingConfigurationBuilder>) |
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. |
DefaultTypeMapping<TScalar>(Action<TypeMappingConfigurationBuilder<TScalar>>) |
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. Calling this won't affect whether properties of this type are discovered. |
DefaultTypeMapping<TScalar>() |
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. Calling this won't affect whether properties of this type are discovered. |
DefaultTypeMapping(Type)
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
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.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder DefaultTypeMapping (Type scalarType);
abstract member DefaultTypeMapping : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
override this.DefaultTypeMapping : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
Public Overridable Function DefaultTypeMapping (scalarType As Type) As TypeMappingConfigurationBuilder
Parameters
- scalarType
- Type
The scalar type to be configured.
Returns
An object that can be used to configure the scalars.
Remarks
Unlike Properties(Type) 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 Properties(Type) should be enough in most cases.
See Pre-convention model building in EF Core for more information and examples.
Applies to
DefaultTypeMapping(Type, Action<TypeMappingConfigurationBuilder>)
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
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.
public virtual Microsoft.EntityFrameworkCore.ModelConfigurationBuilder DefaultTypeMapping (Type scalarType, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder> buildAction);
abstract member DefaultTypeMapping : Type * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder> -> Microsoft.EntityFrameworkCore.ModelConfigurationBuilder
override this.DefaultTypeMapping : Type * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder> -> Microsoft.EntityFrameworkCore.ModelConfigurationBuilder
Public Overridable Function DefaultTypeMapping (scalarType As Type, buildAction As Action(Of TypeMappingConfigurationBuilder)) As ModelConfigurationBuilder
Parameters
- scalarType
- Type
The scalar type to be configured.
- buildAction
- Action<TypeMappingConfigurationBuilder>
An action that performs configuration for the scalars.
Returns
The same ModelConfigurationBuilder instance so that additional configuration calls can be chained.
Remarks
Unlike Properties(Type) 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 Properties(Type) should be enough in most cases.
See Pre-convention model building in EF Core for more information and examples.
Applies to
DefaultTypeMapping<TScalar>(Action<TypeMappingConfigurationBuilder<TScalar>>)
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
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. Calling this won't affect whether properties of this type are discovered.
public virtual Microsoft.EntityFrameworkCore.ModelConfigurationBuilder DefaultTypeMapping<TScalar> (Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<TScalar>> buildAction);
abstract member DefaultTypeMapping : Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<'Scalar>> -> Microsoft.EntityFrameworkCore.ModelConfigurationBuilder
override this.DefaultTypeMapping : Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<'Scalar>> -> Microsoft.EntityFrameworkCore.ModelConfigurationBuilder
Public Overridable Function DefaultTypeMapping(Of TScalar) (buildAction As Action(Of TypeMappingConfigurationBuilder(Of TScalar))) As ModelConfigurationBuilder
Type Parameters
- TScalar
The scalar type to be configured.
Parameters
- buildAction
- Action<TypeMappingConfigurationBuilder<TScalar>>
An action that performs configuration for the scalars.
Returns
The same ModelConfigurationBuilder instance so that additional configuration calls can be chained.
Remarks
Unlike Properties<TProperty>() 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 Properties<TProperty>() should be enough in most cases.
See Pre-convention model building in EF Core for more information and examples.
Applies to
DefaultTypeMapping<TScalar>()
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
- Source:
- ModelConfigurationBuilder.cs
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. Calling this won't affect whether properties of this type are discovered.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<TScalar> DefaultTypeMapping<TScalar> ();
abstract member DefaultTypeMapping : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<'Scalar>
override this.DefaultTypeMapping : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder<'Scalar>
Public Overridable Function DefaultTypeMapping(Of TScalar) () As TypeMappingConfigurationBuilder(Of TScalar)
Type Parameters
- TScalar
The scalar type to be configured.
Returns
An object that can be used to configure the scalars.
Remarks
Unlike Properties<TProperty>() 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 Properties<TProperty>() should be enough in most cases.
See Pre-convention model building in EF Core for more information and examples.
Applies to
Entity Framework