Table of Contents

Interface IReadOnlyPropertyBase

Namespace
Microsoft.EntityFrameworkCore.Metadata
Assembly
Microsoft.EntityFrameworkCore.dll

Base type for navigations and properties.

public interface IReadOnlyPropertyBase : IReadOnlyAnnotatable
Inherited Members
Extension Methods

Remarks

See Modeling entity types and relationships for more information and examples.

Properties

ClrType

Gets the type of value that this property-like object holds.

Type ClrType { get; }

Property Value

Type

DeclaringType

Gets the type that this property-like object belongs to.

IReadOnlyTypeBase DeclaringType { get; }

Property Value

IReadOnlyTypeBase

FieldInfo

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

FieldInfo? FieldInfo { get; }

Property Value

FieldInfo

Name

Gets the name of this property-like object.

string Name { get; }

Property Value

string

PropertyInfo

Gets the PropertyInfo for the underlying CLR property for this property-like object. This may be null for shadow properties or if mapped directly to a field.

PropertyInfo? PropertyInfo { get; }

Property Value

PropertyInfo

Sentinel

Gets the sentinel value that indicates that this property is not set.

object? Sentinel { get; }

Property Value

object

Methods

GetFieldName()

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

string? GetFieldName()

Returns

string

The name of the backing field, or null.

GetPropertyAccessMode()

Gets the PropertyAccessMode being used for this property-like object.

PropertyAccessMode GetPropertyAccessMode()

Returns

PropertyAccessMode

The access mode being used.

IsIndexerProperty()

Gets a value indicating whether this is an indexer property. An indexer property is one that is accessed through an indexer on the entity class.

bool IsIndexerProperty()

Returns

bool

true if the property is an indexer property, otherwise false.

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

Returns

bool

true if the property is a shadow property, otherwise false.