IProperty IProperty Interface

Represents a scalar property of an entity.

Syntax

Declaration

public interface IProperty : IPropertyBase, IAnnotatablePublic Interface IProperty
    Inherits IPropertyBase

Inherited Members

Name,
Name,
DeclaringType,
DeclaringType,
PropertyInfo,
PropertyInfo,
FieldInfo,
FieldInfo,
Item[String],
Item(String),
FindAnnotation(String),
FindAnnotation(String),
GetAnnotations()
GetAnnotations()

Properties summary

Gets the type of value that this property holds.

Gets the entity type that this property belongs to.

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.

Gets a value indicating whether this property can contain null.

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.

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.

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.

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.

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

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.

Properties

  • ClrType
    ClrType

    Gets the type of value that this property holds.

    Type ClrType { get; }ReadOnly Property ClrType As Type

    Property Value

    • System.Type
      System.Type
  • DeclaringEntityType
    DeclaringEntityType

    Gets the entity type that this property belongs to.

    IEntityType DeclaringEntityType { get; }ReadOnly Property DeclaringEntityType As IEntityType

    Property Value

  • 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.

    bool IsConcurrencyToken { get; }ReadOnly Property IsConcurrencyToken As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • IsNullable
    IsNullable

    Gets a value indicating whether this property can contain null.

    bool IsNullable { get; }ReadOnly Property IsNullable As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • 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.

    bool IsReadOnlyAfterSave { get; }ReadOnly Property IsReadOnlyAfterSave As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • 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.

    bool IsReadOnlyBeforeSave { get; }ReadOnly Property IsReadOnlyBeforeSave As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • 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.

    bool IsShadowProperty { get; }ReadOnly Property IsShadowProperty As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • 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.

    bool IsStoreGeneratedAlways { get; }ReadOnly Property IsStoreGeneratedAlways As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • RequiresValueGenerator
    RequiresValueGenerator

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

    bool RequiresValueGenerator { get; }ReadOnly Property RequiresValueGenerator As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • 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.

    ValueGenerated ValueGenerated { get; }ReadOnly Property ValueGenerated As ValueGenerated

    Property Value

Details

Assembly

Microsoft.EntityFrameworkCore.dll