IProperty IProperty IProperty Interface

Definition

Represents a scalar property of an entity.

public interface IProperty : Microsoft.EntityFrameworkCore.Metadata.IPropertyBase
type IProperty = interface
    interface IPropertyBase
    interface IAnnotatable
Public Interface IProperty
Implements IPropertyBase
Derived
Implements

Properties

AfterSaveBehavior AfterSaveBehavior AfterSaveBehavior

Gets a value indicating whether or not this property can be modified after the entity is saved to the database.

If Throw, then an exception will be thrown if a new value is assigned to this property after the entity exists in the database.

If Ignore, then any modification to the property value of an entity that already exists in the database will be ignored.

BeforeSaveBehavior BeforeSaveBehavior BeforeSaveBehavior

Gets a value indicating whether or not this property can be modified before the entity is saved to the database.

If Throw, then an exception will be thrown if a value is assigned to this property when it is in the Added state.

If Ignore, then any value set will be ignored when it is in the Added state.

ClrType ClrType ClrType

Gets the type of value that this property holds.

DeclaringEntityType DeclaringEntityType DeclaringEntityType

Gets the entity type that this property belongs to.

DeclaringType DeclaringType DeclaringType

Gets the type that this property belongs to.

(Inherited from IPropertyBase)
FieldInfo FieldInfo FieldInfo

Gets the FieldInfo for the underlying CLR field that this object represents. This may be null for shadow properties or if the backing field for the property is not known.

(Inherited from IPropertyBase)
IsConcurrencyToken IsConcurrencyToken IsConcurrencyToken

Gets a value indicating whether this property is used as a concurrency token. When a property is configured as a concurrency token the value in the database will be checked when an instance of this entity type is updated or deleted during SaveChanges() to ensure it has not changed since the instance was retrieved from the database. If it has changed, an exception will be thrown and the changes will not be applied to the database.

IsNullable IsNullable IsNullable

Gets a value indicating whether this property can contain null.

IsReadOnlyAfterSave IsReadOnlyAfterSave IsReadOnlyAfterSave

This property is obsolete. Use BeforeSaveBehavior instead.

IsReadOnlyBeforeSave IsReadOnlyBeforeSave IsReadOnlyBeforeSave

This property is obsolete. Use BeforeSaveBehavior instead.

IsShadowProperty IsShadowProperty IsShadowProperty

Gets a value indicating whether this is a shadow property. A shadow property is one that does not have a corresponding property in the entity class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the entity class.

IsStoreGeneratedAlways IsStoreGeneratedAlways IsStoreGeneratedAlways

This property is obsolete. Use BeforeSaveBehavior or AfterSaveBehavior instead.

Name Name Name

Gets the name of the property.

(Inherited from IPropertyBase)
PropertyInfo PropertyInfo PropertyInfo

Gets the PropertyInfo for the underlying CLR property that this object represents. This may be null for shadow properties or properties mapped directly to fields.

(Inherited from IPropertyBase)
RequiresValueGenerator RequiresValueGenerator RequiresValueGenerator

Gets a value indicating whether this property requires a ValueGenerator to generate values when new entities are added to the context.

ValueGenerated ValueGenerated ValueGenerated

Gets a value indicating when a value for this property will be generated by the database. Even when the property is set to be generated by the database, EF may still attempt to save a specific value (rather than having one generated by the database) when the entity is added and a value is assigned, or the property is marked as modified for an existing entity. See BeforeSaveBehavior and AfterSaveBehavior for more information.

Extension Methods

GetAnnotation(IAnnotatable, String) GetAnnotation(IAnnotatable, String) GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

FindRelationalMapping(IProperty) FindRelationalMapping(IProperty) FindRelationalMapping(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetConfiguredColumnType(IProperty) GetConfiguredColumnType(IProperty) GetConfiguredColumnType(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

AnnotationsToDebugString(IAnnotatable, String) AnnotationsToDebugString(IAnnotatable, String) AnnotationsToDebugString(IAnnotatable, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

AsPropertyBase(IPropertyBase, String) AsPropertyBase(IPropertyBase, String) AsPropertyBase(IPropertyBase, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetGetter(IPropertyBase) GetGetter(IPropertyBase) GetGetter(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetIdentifyingMemberInfo(IPropertyBase) GetIdentifyingMemberInfo(IPropertyBase) GetIdentifyingMemberInfo(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetIndex(IPropertyBase) GetIndex(IPropertyBase) GetIndex(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetMemberInfo(IPropertyBase, Boolean, Boolean) GetMemberInfo(IPropertyBase, Boolean, Boolean) GetMemberInfo(IPropertyBase, Boolean, Boolean)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetOriginalValueIndex(IPropertyBase) GetOriginalValueIndex(IPropertyBase) GetOriginalValueIndex(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetPropertyAccessors(IPropertyBase) GetPropertyAccessors(IPropertyBase) GetPropertyAccessors(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetPropertyIndexes(IPropertyBase) GetPropertyIndexes(IPropertyBase) GetPropertyIndexes(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetPropertyInfo(IPropertyBase) GetPropertyInfo(IPropertyBase) GetPropertyInfo(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetRelationshipIndex(IPropertyBase) GetRelationshipIndex(IPropertyBase) GetRelationshipIndex(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetSetter(IPropertyBase) GetSetter(IPropertyBase) GetSetter(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetShadowIndex(IPropertyBase) GetShadowIndex(IPropertyBase) GetShadowIndex(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetStoreGeneratedIndex(IPropertyBase) GetStoreGeneratedIndex(IPropertyBase) GetStoreGeneratedIndex(IPropertyBase)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

SetIndexes(IPropertyBase, PropertyIndexes) SetIndexes(IPropertyBase, PropertyIndexes) SetIndexes(IPropertyBase, PropertyIndexes)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

TryGetMemberInfo(IPropertyBase, Boolean, Boolean, MemberInfo, String) TryGetMemberInfo(IPropertyBase, Boolean, Boolean, MemberInfo, String) TryGetMemberInfo(IPropertyBase, Boolean, Boolean, MemberInfo, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

TrySetIndexes(IPropertyBase, PropertyIndexes) TrySetIndexes(IPropertyBase, PropertyIndexes) TrySetIndexes(IPropertyBase, PropertyIndexes)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

AsProperty(IProperty, String) AsProperty(IProperty, String) AsProperty(IProperty, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

FindMapping(IProperty) FindMapping(IProperty) FindMapping(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

FindPrincipal(IProperty) FindPrincipal(IProperty) FindPrincipal(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

FindPrincipals(IProperty) FindPrincipals(IProperty) FindPrincipals(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

FindSharedTableLink(IProperty) FindSharedTableLink(IProperty) FindSharedTableLink(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

FindSharedTableRootPrimaryKeyProperty(IProperty) FindSharedTableRootPrimaryKeyProperty(IProperty) FindSharedTableRootPrimaryKeyProperty(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetContainingEntityTypes(IProperty) GetContainingEntityTypes(IProperty) GetContainingEntityTypes(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetGenerationProperty(IProperty) GetGenerationProperty(IProperty) GetGenerationProperty(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetOriginalValueIndex(IProperty) GetOriginalValueIndex(IProperty) GetOriginalValueIndex(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetReferencingForeignKeys(IProperty) GetReferencingForeignKeys(IProperty) GetReferencingForeignKeys(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

GetShadowIndex(IProperty) GetShadowIndex(IProperty) GetShadowIndex(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

IsKeyOrForeignKey(IProperty) IsKeyOrForeignKey(IProperty) IsKeyOrForeignKey(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

MayBeStoreGenerated(IProperty) MayBeStoreGenerated(IProperty) MayBeStoreGenerated(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

RequiresOriginalValue(IProperty) RequiresOriginalValue(IProperty) RequiresOriginalValue(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

RequiresValueGenerator(IProperty) RequiresValueGenerator(IProperty) RequiresValueGenerator(IProperty)

Gets a value indicating whether this property requires a ValueGenerator to generate values when new entities are added to the context.

ToDebugString(IProperty, Boolean, String) ToDebugString(IProperty, Boolean, String) ToDebugString(IProperty, Boolean, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

Scaffolding(IProperty) Scaffolding(IProperty) Scaffolding(IProperty)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

IsColumnNullable(IProperty) IsColumnNullable(IProperty) IsColumnNullable(IProperty)

Checks whether or not the column mapped to the given IProperty will be nullable or not when created in the database.

This can depend not just on the property itself, but also how it is mapped. For example, non-nullable properties in a TPH type hierarchy will be mapped to nullable columns.

Scaffolding(IProperty) Scaffolding(IProperty) Scaffolding(IProperty)
GetFieldName(IPropertyBase) GetFieldName(IPropertyBase) GetFieldName(IPropertyBase)

Gets the name of the backing field for this property, or null if the backing field is not known.

GetPropertyAccessMode(IPropertyBase) GetPropertyAccessMode(IPropertyBase) GetPropertyAccessMode(IPropertyBase)

Gets the PropertyAccessMode being used for this property. Null indicates that the default property access mode is being used.

GetContainingForeignKeys(IProperty) GetContainingForeignKeys(IProperty) GetContainingForeignKeys(IProperty)

Gets all foreign keys that use this property (including composite foreign keys in which this property is included).

GetContainingIndexes(IProperty) GetContainingIndexes(IProperty) GetContainingIndexes(IProperty)

Gets all indexes that use this property (including composite indexes in which this property is included).

GetContainingKeys(IProperty) GetContainingKeys(IProperty) GetContainingKeys(IProperty)

Gets all primary or alternate keys that use this property (including composite keys in which this property is included).

GetContainingPrimaryKey(IProperty) GetContainingPrimaryKey(IProperty) GetContainingPrimaryKey(IProperty)

Gets the primary key that uses this property (including a composite primary key in which this property is included).

GetKeyValueComparer(IProperty) GetKeyValueComparer(IProperty) GetKeyValueComparer(IProperty)

Gets the ValueComparer for this property, or null if none is set.

GetMaxLength(IProperty) GetMaxLength(IProperty) GetMaxLength(IProperty)

Gets the maximum length of data that is allowed in this property. For example, if the property is a String ' then this is the maximum number of characters.

GetProviderClrType(IProperty) GetProviderClrType(IProperty) GetProviderClrType(IProperty)

Gets the type that the property value will be converted to before being sent to the database provider.

GetValueComparer(IProperty) GetValueComparer(IProperty) GetValueComparer(IProperty)

Gets the ValueComparer for this property, or null if none is set.

GetValueConverter(IProperty) GetValueConverter(IProperty) GetValueConverter(IProperty)

Gets the custom ValueConverter set for this property.

GetValueGeneratorFactory(IProperty) GetValueGeneratorFactory(IProperty) GetValueGeneratorFactory(IProperty)

Gets the factory that has been set to generate values for this property, if any.

IsForeignKey(IProperty) IsForeignKey(IProperty) IsForeignKey(IProperty)

Gets a value indicating whether this property is used as a foreign key (or part of a composite foreign key).

IsIndex(IProperty) IsIndex(IProperty) IsIndex(IProperty)

Gets a value indicating whether this property is used as an index (or part of a composite index).

IsKey(IProperty) IsKey(IProperty) IsKey(IProperty)

Gets a value indicating whether this property is used as part of a primary or alternate key (or part of a composite primary or alternate key).

IsPrimaryKey(IProperty) IsPrimaryKey(IProperty) IsPrimaryKey(IProperty)

Gets a value indicating whether this property is used as the primary key (or part of a composite primary key).

IsUnicode(IProperty) IsUnicode(IProperty) IsUnicode(IProperty)

Gets a value indicating whether or not the property can persist Unicode characters.

Relational(IProperty) Relational(IProperty) Relational(IProperty)

Gets the relational database specific metadata for a property.

Sqlite(IProperty) Sqlite(IProperty) Sqlite(IProperty)

Gets the SQLite specific metadata for a property.

SqlServer(IProperty) SqlServer(IProperty) SqlServer(IProperty)

Gets the SQL Server specific metadata for a property.

Applies to