OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.HasAnnotation 方法

定义

在拥有的实体类型上添加或更新批注。 如果具有 中指定的 annotation 键的批注已存在,则其值将更新。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> HasAnnotation (string annotation, object value);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> HasAnnotation (string annotation, object? value);
override this.HasAnnotation : string * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.HasAnnotation : string * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function HasAnnotation (annotation As String, value As Object) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function HasAnnotation (annotation As String, value As Object) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

参数

annotation
String

要添加或更新的批注的键。

value
Object

要存储在批注中的值。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

同一生成器实例,以便可以链接多个配置调用。

适用于