Interface IPrincipalKeyValueFactory<TKey>
- Namespace
- Microsoft.EntityFrameworkCore.ChangeTracking
- Assembly
- Microsoft.EntityFrameworkCore.dll
A factory for key values based on the primary/principal key values taken from various forms of entity data.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public interface IPrincipalKeyValueFactory<TKey> : IPrincipalKeyValueFactory
Type Parameters
TKey
The key type.
- Inherited Members
Remarks
See Implementation of database providers and extensions for more information and examples.
Properties
EqualityComparer
An IEqualityComparer<T> for comparing key objects.
IEqualityComparer<TKey> EqualityComparer { get; }
Property Value
- IEqualityComparer<TKey>
Methods
CreateFromBuffer(ValueBuffer)
Creates a key object from key values obtained from their indexed position in the given ValueBuffer.
object? CreateFromBuffer(ValueBuffer valueBuffer)
Parameters
valueBuffer
ValueBufferThe buffer containing key values.
Returns
- object
The key object, or null if any of the key values were null.
CreateFromCurrentValues(IUpdateEntry)
Creates a key object from the key values in the given entry.
TKey? CreateFromCurrentValues(IUpdateEntry entry)
Parameters
entry
IUpdateEntryThe entry tracking an entity instance.
Returns
- TKey
The key value.
CreateFromKeyValues(IReadOnlyList<object?>)
Creates a key object from key values obtained in-order from the given enumerable.
object? CreateFromKeyValues(IReadOnlyList<object?> keyValues)
Parameters
keyValues
IReadOnlyList<object>The key values.
Returns
- object
The key object, or null if any of the key values were null.
CreateFromOriginalValues(IUpdateEntry)
Creates a key object from the original key values in the given entry.
TKey? CreateFromOriginalValues(IUpdateEntry entry)
Parameters
entry
IUpdateEntryThe entry tracking an entity instance.
Returns
- TKey
The key value.
CreateFromRelationshipSnapshot(IUpdateEntry)
Creates a key object from the relationship snapshot key values in the given entry.
TKey CreateFromRelationshipSnapshot(IUpdateEntry entry)
Parameters
entry
IUpdateEntryThe entry tracking an entity instance.
Returns
- TKey
The key value.
FindNullPropertyInCurrentValues(IUpdateEntry)
Finds the first null key value in the given entry and returns the associated IProperty.
IProperty? FindNullPropertyInCurrentValues(IUpdateEntry entry)
Parameters
entry
IUpdateEntryThe entry tracking an entity instance.
Returns
- IProperty
The associated property.
FindNullPropertyInKeyValues(IReadOnlyList<object?>)
Finds the first null in the given in-order array of key values and returns the associated IProperty.
IProperty? FindNullPropertyInKeyValues(IReadOnlyList<object?> keyValues)
Parameters
keyValues
IReadOnlyList<object>The key values.
Returns
- IProperty
The associated property.