语言

IdKeyDiscoveryConvention 类

定义

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

  1. 'Id'
  2. [类型名称]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. [类型名称]ID 主键检测不区分大小写。

方法

名称 说明
Apply(EntityType, DbModel)

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

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

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

适用于