EntityEntry.IsKeySet Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating if the key values of this entity have been assigned a value.
public virtual bool IsKeySet { get; }
member this.IsKeySet : bool
Public Overridable ReadOnly Property IsKeySet As Boolean
Property Value
Remarks
For keys with store-generated properties (e.g. mapping to Identity columns), the return value will be false if any of the store-generated properties have the CLR default value.
For keys without any store-generated properties, the return value will always be true since any value is considered a valid key value.
See EF Core change tracking for more information and examples.
Applies to
Entity Framework