EntityMappingConfiguration<TEntityType> EntityMappingConfiguration<TEntityType> EntityMappingConfiguration<TEntityType> Class

Definition

Configures the table and column mapping for an entity type or a sub-set of properties from an entity type. This configuration functionality is available via the Code First Fluent API, see DbModelBuilder.

public class EntityMappingConfiguration<TEntityType> where TEntityType : class
type EntityMappingConfiguration<'EntityType (requires 'EntityType : null)> = class
Public Class EntityMappingConfiguration(Of TEntityType)

Type Parameters

TEntityType

The entity type to be mapped.

Inheritance
EntityMappingConfiguration<TEntityType>EntityMappingConfiguration<TEntityType>EntityMappingConfiguration<TEntityType>

Constructors

EntityMappingConfiguration<TEntityType>() EntityMappingConfiguration<TEntityType>() EntityMappingConfiguration<TEntityType>()

Initializes a new instance of the EntityMappingConfiguration<TEntityType> class.

Methods

Equals(Object) Equals(Object) Equals(Object)
GetHashCode() GetHashCode() GetHashCode()
GetType() GetType() GetType()

Gets the Type of the current instance.

HasTableAnnotation(String, Object) HasTableAnnotation(String, Object) HasTableAnnotation(String, Object)

Sets an annotation in the model for the table to which this entity is mapped. The annotation value can later be used when processing the table such as when creating migrations.

MapInheritedProperties() MapInheritedProperties() MapInheritedProperties()

Re-maps all properties inherited from base types. When configuring a derived type to be mapped to a separate table this will cause all properties to be included in the table rather than just the non-inherited properties. This is known as Table per Concrete Type (TPC) mapping.

Properties<TObject>(Expression<Func<TEntityType,TObject>>) Properties<TObject>(Expression<Func<TEntityType,TObject>>) Properties<TObject>(Expression<Func<TEntityType,TObject>>)

Configures the properties that will be included in this mapping fragment. If this method is not called then all properties that have not yet been included in a mapping fragment will be configured.

Property(Expression<Func<TEntityType,TimeSpan>>) Property(Expression<Func<TEntityType,TimeSpan>>) Property(Expression<Func<TEntityType,TimeSpan>>)

Configures a TimeSpan property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,String>>) Property(Expression<Func<TEntityType,String>>) Property(Expression<Func<TEntityType,String>>)

Configures a System.string property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Nullable<TimeSpan>>>) Property(Expression<Func<TEntityType,Nullable<TimeSpan>>>) Property(Expression<Func<TEntityType,Nullable<TimeSpan>>>)

Configures a System.TimeSpan? property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Nullable<Decimal>>>) Property(Expression<Func<TEntityType,Nullable<Decimal>>>) Property(Expression<Func<TEntityType,Nullable<Decimal>>>)

Configures a System.decimal? property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Nullable<DateTimeOffset>>>) Property(Expression<Func<TEntityType,Nullable<DateTimeOffset>>>) Property(Expression<Func<TEntityType,Nullable<DateTimeOffset>>>)

Configures a System.DateTimeOffset? property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Nullable<DateTime>>>) Property(Expression<Func<TEntityType,Nullable<DateTime>>>) Property(Expression<Func<TEntityType,Nullable<DateTime>>>)

Configures a System.DateTime? property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Decimal>>) Property(Expression<Func<TEntityType,Decimal>>) Property(Expression<Func<TEntityType,Decimal>>)

Configures a System.decimal property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,DateTimeOffset>>) Property(Expression<Func<TEntityType,DateTimeOffset>>) Property(Expression<Func<TEntityType,DateTimeOffset>>)

Configures a DateTimeOffset property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,DateTime>>) Property(Expression<Func<TEntityType,DateTime>>) Property(Expression<Func<TEntityType,DateTime>>)

Configures a DateTime property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,DbGeometry>>) Property(Expression<Func<TEntityType,DbGeometry>>) Property(Expression<Func<TEntityType,DbGeometry>>)

Configures a DbGeometry property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,DbGeography>>) Property(Expression<Func<TEntityType,DbGeography>>) Property(Expression<Func<TEntityType,DbGeography>>)

Configures a DbGeography property that is included in this mapping fragment.

Property(Expression<Func<TEntityType,Byte[]>>) Property(Expression<Func<TEntityType,Byte[]>>) Property(Expression<Func<TEntityType,Byte[]>>)

Configures a System.byte[] property that is included in this mapping fragment.

Property<T>(Expression<Func<TEntityType,Nullable<T>>>) Property<T>(Expression<Func<TEntityType,Nullable<T>>>) Property<T>(Expression<Func<TEntityType,Nullable<T>>>)

Configures a System.struct? property that is included in this mapping fragment.

Property<T>(Expression<Func<TEntityType,T>>) Property<T>(Expression<Func<TEntityType,T>>) Property<T>(Expression<Func<TEntityType,T>>)

Configures a System.struct property that is included in this mapping fragment.

Requires(String) Requires(String) Requires(String)

Configures the discriminator column used to differentiate between types in an inheritance hierarchy.

Requires<TProperty>(Expression<Func<TEntityType,TProperty>>) Requires<TProperty>(Expression<Func<TEntityType,TProperty>>) Requires<TProperty>(Expression<Func<TEntityType,TProperty>>)

Configures the discriminator condition used to differentiate between types in an inheritance hierarchy.

ToString() ToString() ToString()
ToTable(String) ToTable(String) ToTable(String)

Configures the table name to be mapped to.

ToTable(String, String) ToTable(String, String) ToTable(String, String)

Configures the table name and schema to be mapped to.

Applies to