ValueGenerator<TValue> ValueGenerator(Of TValue) Class

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

Syntax

Declaration

public abstract class ValueGenerator<TValue> : ValueGeneratorPublic MustInherit Class ValueGenerator(Of TValue)
    Inherits ValueGenerator

Type Parameters

TValue

Inheritance Hierarchy

Inherited Members

GeneratesTemporaryValues,
GeneratesTemporaryValues,
ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Methods summary

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

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

Gets a value to be assigned to a property.

Gets a value to be assigned to a property.

Methods

  • 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

    • entry
    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

    Returns

    • System.Threading.Tasks.Task<TResult><TValue>
      System.Threading.Tasks.Task<TResult>(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.

  • 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

    • entry
    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

    Returns

    • System.Threading.Tasks.Task<TResult><System.Object>
      System.Threading.Tasks.Task<TResult>(Of System.Object)

      The value to be assigned to a property.

Details

Assembly

Microsoft.EntityFrameworkCore.dll