Share via


ValueGeneratorCache Class

Definition

Keeps a cache of value generators for properties.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public abstract class ValueGeneratorCache : Microsoft.EntityFrameworkCore.ValueGeneration.IValueGeneratorCache
public class ValueGeneratorCache : Microsoft.EntityFrameworkCore.ValueGeneration.IValueGeneratorCache
type ValueGeneratorCache = class
    interface IValueGeneratorCache
Public MustInherit Class ValueGeneratorCache
Implements IValueGeneratorCache
Public Class ValueGeneratorCache
Implements IValueGeneratorCache
Inheritance
ValueGeneratorCache
Implements

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Implementation of database providers and extensions for more information and examples.

Constructors

ValueGeneratorCache()
ValueGeneratorCache(ValueGeneratorCacheDependencies)

Initializes a new instance of the ValueGeneratorCache class.

Properties

Dependencies

Dependencies for this service.

Methods

GetOrAdd(IProperty, IEntityType, Func<IProperty,IEntityType,ValueGenerator>)

Gets the existing value generator from the cache, or creates a new one if one is not present in the cache.

GetOrAdd(IProperty, ITypeBase, Func<IProperty,ITypeBase,ValueGenerator>)

Gets the existing value generator from the cache, or creates a new one if one is not present in the cache.

Applies to