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>

Constructors

EntityMappingConfiguration<TEntityType>()

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

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

GetType()

Gets the Type of the current instance.

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()

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>>)

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,Byte[]>>)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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>>)

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

Requires(String)

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

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

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

ToString()

Returns a string that represents the current object.

ToTable(String)

Configures the table name to be mapped to.

ToTable(String, String)

Configures the table name and schema to be mapped to.

Applies to