RequiredPropertyAttributeConvention 类

定义

一种约定,该约定在应用了 RequiredAttribute 的情况下根据需要配置属性。

public class RequiredPropertyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.RequiredAttribute>
public class RequiredPropertyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.RequiredAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyFieldChangedConvention
type RequiredPropertyAttributeConvention = class
    inherit PropertyAttributeConventionBase<RequiredAttribute>
type RequiredPropertyAttributeConvention = class
    inherit PropertyAttributeConventionBase<RequiredAttribute>
    interface IComplexPropertyAddedConvention
    interface IConvention
    interface IComplexPropertyFieldChangedConvention
Public Class RequiredPropertyAttributeConvention
Inherits PropertyAttributeConventionBase(Of RequiredAttribute)
Public Class RequiredPropertyAttributeConvention
Inherits PropertyAttributeConventionBase(Of RequiredAttribute)
Implements IComplexPropertyAddedConvention, IComplexPropertyFieldChangedConvention
继承
RequiredPropertyAttributeConvention
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

RequiredPropertyAttributeConvention(ProviderConventionSetBuilderDependencies)

创建 RequiredPropertyAttributeConvention 的新实例。

属性

Dependencies

此服务的依赖项。

(继承自 PropertyAttributeConventionBase<TAttribute>)

方法

ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

在将复杂属性添加到类似类型的对象后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在更改复杂属性的后备字段后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionComplexPropertyBuilder, RequiredAttribute, MemberInfo, IConventionContext)

一种约定,该约定在应用了 RequiredAttribute 的情况下根据需要配置属性。

ProcessPropertyAdded(IConventionComplexPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将复杂属性添加到具有关联 CLR 属性或字段特性的类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在将属性添加到实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, RequiredAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

ProcessPropertyAdded(IConventionPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

更改属性的后备字段后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)

适用于