อ่านในภาษาอังกฤษ

แชร์ผ่าน


AnnotatableBase.GetOrAddRuntimeAnnotationValue<TValue,TArg> Method

Definition

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

C#
public virtual TValue GetOrAddRuntimeAnnotationValue<TValue,TArg> (string name, Func<TArg?,TValue> valueFactory, TArg? factoryArgument);

Type Parameters

TValue
TArg

Parameters

name
String

The name of the annotation.

valueFactory
Func<TArg,TValue>

The factory used to create the value if the annotation doesn't exist.

factoryArgument
TArg

An argument for the factory method.

Returns

TValue

The value of the existing runtime annotation if an annotation with the specified name already exists. Otherwise a newly created value.

Implements

Applies to

ผลิตภัณฑ์ เวอร์ชัน
Entity Framework Core 6.0, 7.0, 8.0, 9.0