Table of Contents

Interface IProperty

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

Represents a scalar property of a structural type.

public interface IProperty : IReadOnlyProperty, IPropertyBase, IReadOnlyPropertyBase, IAnnotatable, IReadOnlyAnnotatable
Inherited Members
Extension Methods

Remarks

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

Properties

DeclaringEntityType

Gets the entity type that this property belongs to.

[Obsolete("Use DeclaringType and cast to IEntityType or IComplexType")]
IEntityType DeclaringEntityType { get; }

Property Value

IEntityType

Methods

CreateKeyEqualityComparer<TProperty>()

Creates an IEqualityComparer<T> for values of the given property type.

IEqualityComparer<TProperty> CreateKeyEqualityComparer<TProperty>()

Returns

IEqualityComparer<TProperty>

A new equality comparer.

Type Parameters

TProperty

The property type.

FindContainingPrimaryKey()

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

IKey? FindContainingPrimaryKey()

Returns

IKey

The primary that use this property, or null if it is not part of the primary key.

FindFirstPrincipal()

Finds the first principal property that the given property is constrained by if the given property is part of a foreign key.

IProperty? FindFirstPrincipal()

Returns

IProperty

The first associated principal property, or null if none exists.

GetContainingForeignKeys()

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

IEnumerable<IForeignKey> GetContainingForeignKeys()

Returns

IEnumerable<IForeignKey>

The foreign keys that use this property.

GetContainingIndexes()

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

IEnumerable<IIndex> GetContainingIndexes()

Returns

IEnumerable<IIndex>

The indexes that use this property.

GetContainingKeys()

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

IEnumerable<IKey> GetContainingKeys()

Returns

IEnumerable<IKey>

The primary and alternate keys that use this property.

GetElementType()

Gets the configuration for elements of the primitive collection represented by this property.

IElementType? GetElementType()

Returns

IElementType

The configuration for the elements.

GetKeyValueComparer()

Gets the ValueComparer to use with keys for this property.

ValueComparer GetKeyValueComparer()

Returns

ValueComparer

The comparer.

GetPrincipals()

Finds the list of principal properties including the given property that the given property is constrained by if the given property is part of a foreign key.

IReadOnlyList<IProperty> GetPrincipals()

Returns

IReadOnlyList<IProperty>

The list of all associated principal properties including the given property.

GetProviderValueComparer()

Gets the ValueComparer to use for the provider values for this property.

ValueComparer GetProviderValueComparer()

Returns

ValueComparer

The comparer.

GetValueComparer()

Gets the ValueComparer for this property.

ValueComparer GetValueComparer()

Returns

ValueComparer

The comparer.