IdKeyDiscoveryConvention 类

定义

用于检测主键属性的约定。 按优先级顺序识别的命名模式包括:

  1. “Id”
  2. [type name]ID 主键检测不区分大小写。
public class IdKeyDiscoveryConvention : System.Data.Entity.ModelConfiguration.Conventions.KeyDiscoveryConvention
type IdKeyDiscoveryConvention = class
    inherit KeyDiscoveryConvention
Public Class IdKeyDiscoveryConvention
Inherits KeyDiscoveryConvention
继承
IdKeyDiscoveryConvention
继承
IdKeyDiscoveryConvention

构造函数

IdKeyDiscoveryConvention()

用于检测主键属性的约定。 按优先级顺序识别的命名模式包括:

  1. “Id”
  2. [type name]ID 主键检测不区分大小写。

方法

Apply(EntityType, DbModel)

将此约定应用于模型中的项。

(继承自 KeyDiscoveryConvention)
MatchKeyProperty(EntityType, IEnumerable<EdmProperty>)

重写时返回将成为主键一部分的属性子集。

MatchKeyProperty(EntityType, IEnumerable<EdmProperty>)

重写时返回将成为主键一部分的属性子集。

(继承自 KeyDiscoveryConvention)

适用于