ValueGenerator<TValue> ValueGenerator(Of TValue) Class

Definition

Generates values for properties when an entity is added to a context.

public abstract class ValueGenerator<TValue> : ValueGenerator
Public MustInherit Class ValueGenerator(Of TValue)
    Inherits ValueGenerator
Type Parameters
TValue
Inheritance
System.ObjectSystem.Object
ValueGenerator<TValue>ValueGenerator(Of TValue)

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

Next(EntityEntry) Next(EntityEntry)

Template method to be overridden by implementations to perform value generation.

public abstract TValue Next(EntityEntry entry)
Public MustOverride Function Next(entry As EntityEntry) As TValue
Parameters
Returns
TValue TValue

The generated value.

NextAsync(EntityEntry, CancellationToken) NextAsync(EntityEntry, CancellationToken)

Template method to be overridden by implementations to perform value generation.

public virtual Task<TValue> NextAsync(EntityEntry entry, CancellationToken cancellationToken = null)
Public Overridable Function NextAsync(entry As EntityEntry, cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<TValue> System.Threading.Tasks.Task(Of TValue)

The generated value.

NextValue(EntityEntry) NextValue(EntityEntry)

Gets a value to be assigned to a property.

protected override object NextValue(EntityEntry entry)
Protected Overrides Function NextValue(entry As EntityEntry) As Object
Parameters
Returns
System.Object System.Object

The value to be assigned to a property.

Overrides

NextValueAsync(EntityEntry, CancellationToken) NextValueAsync(EntityEntry, CancellationToken)

Gets a value to be assigned to a property.

protected override Task<object> NextValueAsync(EntityEntry entry, CancellationToken cancellationToken = null)
Protected Overrides Function NextValueAsync(entry As EntityEntry, cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<System.Object> System.Threading.Tasks.Task(Of System.Object)

The value to be assigned to a property.

Overrides

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object

Properties

GeneratesTemporaryValues GeneratesTemporaryValues

Gets a value indicating whether the values generated are temporary (i.e they should be replaced by database generated values when the entity is saved) or are permanent (i.e. the generated values should be saved to the database).

An example of temporary value generation is generating negative numbers for an integer primary key that are then replaced by positive numbers generated by the database when the entity is saved. An example of permanent value generation are client-generated values for a System.Guid primary key which are saved to the database.

(Inherited from ValueGenerator)