ValueGeneratorCache.GetOrAdd 方法

定义

重载

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

从缓存中获取现有值生成器,如果缓存中不存在值生成器,则创建一个新值生成器。

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

从缓存中获取现有值生成器,如果缓存中不存在值生成器,则创建一个新值生成器。

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

从缓存中获取现有值生成器,如果缓存中不存在值生成器,则创建一个新值生成器。

public virtual Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator GetOrAdd (Microsoft.EntityFrameworkCore.Metadata.IProperty property, Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> factory);
abstract member GetOrAdd : Microsoft.EntityFrameworkCore.Metadata.IProperty * Microsoft.EntityFrameworkCore.Metadata.IEntityType * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> -> Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator
override this.GetOrAdd : Microsoft.EntityFrameworkCore.Metadata.IProperty * Microsoft.EntityFrameworkCore.Metadata.IEntityType * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> -> Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator
Public Overridable Function GetOrAdd (property As IProperty, entityType As IEntityType, factory As Func(Of IProperty, IEntityType, ValueGenerator)) As ValueGenerator

参数

property
IProperty

要获取其值生成器的属性。

entityType
IEntityType

值生成器将用于的实体类型。 当对派生实体类型的继承属性调用时,此实体类型可能与上声明的实体类型不同 property

factory
Func<IProperty,IEntityType,ValueGenerator>

工厂:如果缓存中不存在值生成器,则创建新的值生成器。

返回

现有或新创建的值生成器。

实现

适用于

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

从缓存中获取现有值生成器,如果缓存中不存在值生成器,则创建一个新值生成器。

public virtual Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator GetOrAdd (Microsoft.EntityFrameworkCore.Metadata.IProperty property, Microsoft.EntityFrameworkCore.Metadata.ITypeBase typeBase, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.ITypeBase,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> factory);
abstract member GetOrAdd : Microsoft.EntityFrameworkCore.Metadata.IProperty * Microsoft.EntityFrameworkCore.Metadata.ITypeBase * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.ITypeBase, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> -> Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator
override this.GetOrAdd : Microsoft.EntityFrameworkCore.Metadata.IProperty * Microsoft.EntityFrameworkCore.Metadata.ITypeBase * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.ITypeBase, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> -> Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator
Public Overridable Function GetOrAdd (property As IProperty, typeBase As ITypeBase, factory As Func(Of IProperty, ITypeBase, ValueGenerator)) As ValueGenerator

参数

property
IProperty

要获取其值生成器的属性。

typeBase
ITypeBase

值生成器将用于的实体类型。 当对派生实体类型的继承属性调用时,此实体类型可能与上声明的实体类型不同 property

factory
Func<IProperty,ITypeBase,ValueGenerator>

工厂:如果缓存中不存在值生成器,则创建新的值生成器。

返回

现有或新创建的值生成器。

实现

适用于