共用方式為


DbContextConfiguration.ProxyCreationEnabled 屬性

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

取得或設定值,指出每當此架構建立實體類型的執行個體時,它是否會建立動態產生之 Proxy 類別的執行個體。 請注意,即使使用此旗標來啟用 Proxy 建立,也只會針對符合進行 Proxy 處理需求的實體類型來建立 Proxy 執行個體。 預設會啟用 Proxy 建立。

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

語法

'宣告
Public Property ProxyCreationEnabled As Boolean 
    Get 
    Set
'用途
Dim instance As DbContextConfiguration 
Dim value As Boolean 

value = instance.ProxyCreationEnabled

instance.ProxyCreationEnabled = value
public bool ProxyCreationEnabled { get; set; }
public:
property bool ProxyCreationEnabled {
    bool get ();
    void set (bool value);
}
member ProxyCreationEnabled : bool with get, set
function get ProxyCreationEnabled () : boolean 
function set ProxyCreationEnabled (value : boolean)

屬性值

類型:System.Boolean
如果啟用 Proxy 建立,則為 true;否則為 false。

請參閱

參考

DbContextConfiguration 類別

System.Data.Entity.Infrastructure 命名空間