IProperty IProperty Interface

Definition

Represents a scalar property of an entity.

public interface IProperty : IPropertyBase, IAnnotatable
Public Interface IProperty
    Inherits IPropertyBase

Properties

ClrType ClrType

Gets the type of value that this property holds.

DeclaringEntityType DeclaringEntityType

Gets the entity type that this property belongs to.

DeclaringType DeclaringType

Gets the type that this property belongs to.

(Inherited from IPropertyBase)
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

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

Gets a value indicating whether this property can contain null.

IsReadOnlyAfterSave IsReadOnlyAfterSave

Gets a value indicating whether or not this property can be modified after the entity is saved to the database. If true, an exception will be thrown if a new value is assigned to this property after the entity exists in the database.

IsReadOnlyBeforeSave IsReadOnlyBeforeSave

Gets a value indicating whether or not this property can be modified before the entity is saved to the database. If true, an exception will be thrown if a value is assigned to this property when it is in the Added state.

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

Gets a value indicating whether or not the database will always generate a value for this property. If set to true, a value will always be read back from the database whenever the entity is saved regardless of the state of the property. If set to false, whenever a value is assigned to the property (or marked as modified) EF will attempt to save that value to the database rather than letting the database generate one.

Item[String] Item(String)

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from IAnnotatable)
Name Name

Gets the name of the property.

(Inherited from IPropertyBase)
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

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

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 IsStoreGeneratedAlways for more information.

Methods

FindAnnotation(String) FindAnnotation(String)

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

(Inherited from IAnnotatable)
GetAnnotations() GetAnnotations()

Gets all annotations on the current object.

(Inherited from IAnnotatable)

Extension Methods

Microsoft.EntityFrameworkCore.SqlServerMetadataExtensions.SqlServer() Microsoft.EntityFrameworkCore.SqlServerMetadataExtensions.SqlServer()
Microsoft.EntityFrameworkCore.PropertyBaseExtensions.GetField() Microsoft.EntityFrameworkCore.PropertyBaseExtensions.GetField()
Microsoft.EntityFrameworkCore.PropertyBaseExtensions.GetPropertyAccessMode() Microsoft.EntityFrameworkCore.PropertyBaseExtensions.GetPropertyAccessMode()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetValueGeneratorFactory() Microsoft.EntityFrameworkCore.PropertyExtensions.GetValueGeneratorFactory()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetMaxLength() Microsoft.EntityFrameworkCore.PropertyExtensions.GetMaxLength()
Microsoft.EntityFrameworkCore.PropertyExtensions.IsUnicode() Microsoft.EntityFrameworkCore.PropertyExtensions.IsUnicode()
Microsoft.EntityFrameworkCore.PropertyExtensions.IsForeignKey() Microsoft.EntityFrameworkCore.PropertyExtensions.IsForeignKey()
Microsoft.EntityFrameworkCore.PropertyExtensions.IsIndex() Microsoft.EntityFrameworkCore.PropertyExtensions.IsIndex()
Microsoft.EntityFrameworkCore.PropertyExtensions.IsPrimaryKey() Microsoft.EntityFrameworkCore.PropertyExtensions.IsPrimaryKey()
Microsoft.EntityFrameworkCore.PropertyExtensions.IsKey() Microsoft.EntityFrameworkCore.PropertyExtensions.IsKey()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingForeignKeys() Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingForeignKeys()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingIndexes() Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingIndexes()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingPrimaryKey() Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingPrimaryKey()
Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingKeys() Microsoft.EntityFrameworkCore.PropertyExtensions.GetContainingKeys()
Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableExtensions.GetAnnotation(System.String) Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableExtensions.GetAnnotation(System.String)
Microsoft.EntityFrameworkCore.Metadata.Internal.AnnotatableExtensions.AnnotationsToDebugString(System.String) Microsoft.EntityFrameworkCore.Metadata.Internal.AnnotatableExtensions.AnnotationsToDebugString(System.String)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetShadowIndex() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetShadowIndex()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetStoreGeneratedIndex() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetStoreGeneratedIndex()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetRelationshipIndex() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetRelationshipIndex()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetIndex() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetIndex()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetPropertyIndexes() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetPropertyIndexes()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.TrySetIndexes(PropertyIndexes) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.TrySetIndexes(PropertyIndexes)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetPropertyAccessors() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetPropertyAccessors()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetGetter() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetGetter()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetSetter() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetSetter()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetMemberInfo(System.Boolean, System.Boolean) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetMemberInfo(System.Boolean, System.Boolean)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.TryGetMemberInfo(System.Boolean, System.Boolean, System.Reflection.MemberInfo, System.String) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.TryGetMemberInfo(System.Boolean, System.Boolean, System.Reflection.MemberInfo, System.String)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.AsPropertyBase(System.String) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.AsPropertyBase(System.String)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetContainingEntityTypes() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetContainingEntityTypes()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetReferencingForeignKeys() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetReferencingForeignKeys()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetGenerationProperty() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetGenerationProperty()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetOriginalValueIndex() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.GetOriginalValueIndex()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.MayBeStoreGenerated() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.MayBeStoreGenerated()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.RequiresOriginalValue() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.RequiresOriginalValue()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.IsKeyOrForeignKey() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.IsKeyOrForeignKey()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.FindPrincipal() Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.FindPrincipal()
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.ToDebugString(System.Boolean, System.String) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.ToDebugString(System.Boolean, System.String)
Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.AsProperty(System.String) Microsoft.EntityFrameworkCore.Metadata.Internal.PropertyExtensions.AsProperty(System.String)
Microsoft.EntityFrameworkCore.SqliteMetadataExtensions.Sqlite() Microsoft.EntityFrameworkCore.SqliteMetadataExtensions.Sqlite()
Microsoft.EntityFrameworkCore.Metadata.ScaffoldingMetadataExtensions.Scaffolding() Microsoft.EntityFrameworkCore.Metadata.ScaffoldingMetadataExtensions.Scaffolding()
Microsoft.EntityFrameworkCore.Relational.Tests.TestRelationalMetadataExtensions.TestProvider() Microsoft.EntityFrameworkCore.Relational.Tests.TestRelationalMetadataExtensions.TestProvider()
Microsoft.EntityFrameworkCore.RelationalMetadataExtensions.Relational() Microsoft.EntityFrameworkCore.RelationalMetadataExtensions.Relational()
Microsoft.EntityFrameworkCore.Metadata.RelationalPropertyExtensions.IsColumnNullable() Microsoft.EntityFrameworkCore.Metadata.RelationalPropertyExtensions.IsColumnNullable()