Class GuidValueGenerator
- Namespace
- Microsoft.EntityFrameworkCore.ValueGeneration
- Assembly
- Microsoft.EntityFrameworkCore.dll
Generates Guid values using NewGuid(). The generated values are non-temporary, meaning they will be saved to the database.
public class GuidValueGenerator : ValueGenerator<Guid>
- Inheritance
-
GuidValueGenerator
- Derived
- Inherited Members
Remarks
See EF Core value generation for more information and examples.
Constructors
GuidValueGenerator()
public GuidValueGenerator()
Properties
GeneratesTemporaryValues
Gets a value indicating whether the values generated are temporary or permanent. This implementation always returns false, meaning the generated values will be saved to the database.
public override bool GeneratesTemporaryValues { get; }
Property Value
Methods
Next(EntityEntry)
Gets a value to be assigned to a property.
public override Guid Next(EntityEntry entry)
Parameters
entry
EntityEntryThe change tracking entry of the entity for which the value is being generated.
Returns
- Guid
The value to be assigned to a property.