共用方式為


IValueGeneratorCache.GetOrAdd 方法

定義

多載

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

從快取取得現有的值產生器,如果快取中沒有值產生器,則建立新的值產生器。

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

從快取取得現有的值產生器,如果快取中沒有值產生器,則建立新的值產生器。

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

來源:
IValueGeneratorCache.cs

從快取取得現有的值產生器,如果快取中沒有值產生器,則建立新的值產生器。

public 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
Public 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>

如果快取中沒有值產生器,則為 Factory 來建立新的值產生器。

傳回

現有或新建立的值產生器。

適用於

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

來源:
IValueGeneratorCache.cs
來源:
IValueGeneratorCache.cs

從快取取得現有的值產生器,如果快取中沒有值產生器,則建立新的值產生器。

public 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);
public 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
Public 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>

如果快取中沒有值產生器,則為 Factory 來建立新的值產生器。

傳回

現有或新建立的值產生器。

適用於