Share via


PropertyExtensions Class

Definition

Caution

Use IReadOnlyProperty

Extension methods for IReadOnlyProperty.

public static class PropertyExtensions
[System.Obsolete("Use IReadOnlyProperty")]
public static class PropertyExtensions
type PropertyExtensions = class
[<System.Obsolete("Use IReadOnlyProperty")>]
type PropertyExtensions = class
Public Module PropertyExtensions
Inheritance
PropertyExtensions
Attributes

Methods

CreateKeyEqualityComparer<TProperty>(IProperty)

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

FindContainingPrimaryKey(IProperty)

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

FindFirstPrincipal(IProperty)

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

FindMapping(IProperty)
Obsolete.

Returns the CoreTypeMapping for the given property.

FindPrincipals(IProperty)
Obsolete.

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.

FindTypeMapping(IProperty)

Returns the CoreTypeMapping for the given property.

Format(IEnumerable<IPropertyBase>, Boolean)

Creates a formatted string representation of the given properties such as is useful when throwing exceptions about keys, indexes, etc. that use the properties.

GetAfterSaveBehavior(IProperty)
Obsolete.

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.

GetBeforeSaveBehavior(IProperty)
Obsolete.

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.

GetContainingForeignKeys(IProperty)

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

GetContainingIndexes(IProperty)

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

GetContainingKeys(IProperty)

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

GetContainingPrimaryKey(IProperty)
Obsolete.

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

GetKeyValueComparer(IProperty)

Gets the ValueComparer to use with keys for this property, or null if none is set.

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.

GetPrecision(IProperty)

Gets the precision of data that is allowed in this property. For example, if the property is a Decimal then this is the maximum number of digits.

GetProviderClrType(IProperty)

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

GetScale(IProperty)

Gets the scale of data that is allowed in this property. For example, if the property is a Decimal then this is the maximum number of decimal places.

GetStructuralValueComparer(IProperty)
Obsolete.

Gets the ValueComparer to use for structural copies for this property, or null if none is set.

GetTypeMapping(IProperty)

Returns the CoreTypeMapping for the given property from a finalized model.

GetValueComparer(IProperty)

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

GetValueConverter(IProperty)
Obsolete.

Gets the custom ValueConverter set for this property.

GetValueGeneratorFactory(IProperty)
Obsolete.

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

IsForeignKey(IProperty)
Obsolete.

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

IsIndex(IProperty)
Obsolete.

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

IsKey(IProperty)
Obsolete.

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

IsPrimaryKey(IProperty)
Obsolete.

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

IsUnicode(IProperty)

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

IsUniqueIndex(IProperty)
Obsolete.

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

ToDebugString(IProperty, MetadataDebugStringOptions, Int32)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

Applies to