Class StringValueGenerator
- Namespace
- Microsoft.EntityFrameworkCore.ValueGeneration
- Assembly
- Microsoft.EntityFrameworkCore.dll
Generates string values using a string representation of NewGuid(). The generated values are non-temporary, meaning they will be saved to the database.
public class StringValueGenerator : ValueGenerator<string>
- Inheritance
-
StringValueGenerator
- Inherited Members
Remarks
See EF Core value generation for more information and examples.
Constructors
StringValueGenerator()
public StringValueGenerator()
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 string Next(EntityEntry entry)
Parameters
entry
EntityEntry
Returns
- string
The value to be assigned to a property.