共用方式為


ConventionsConfiguration.Add<TConvention> 方法

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

啟用 DbModelBuilder 的慣例。

命名空間:  System.Data.Entity.ModelConfiguration.Configuration
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")> _
Public Sub Add(Of TConvention As {New, IConvention})
'用途
Dim instance As ConventionsConfiguration

instance.Add()
[SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public void Add<TConvention>()
where TConvention : new(), IConvention
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1004:GenericMethodsShouldProvideTypeParameter")]
public:
generic<typename TConvention>
where TConvention : gcnew(), IConvention 
void Add()
[<SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")>]
member Add : unit -> unit   when 'TConvention : new() and IConvention
JScript does not support generic types and methods.

類型參數

  • TConvention
    要啟用之慣例的類型。

請參閱

參考

ConventionsConfiguration 類別

Add 多載

System.Data.Entity.ModelConfiguration.Configuration 命名空間