【发布时间】:2015-05-24 03:30:37
【问题描述】:
我对 EF 中的动态代理意味着什么感到困惑?动态代理与延迟或急切加载之间是否存在关系。
例如我有以下视图模型:-
public class ServerJoin
{
public Server Server { get; set; }
public Resource Resource { get; set; }
public Technology Technology { get; set; }
//public ComponentDefinition ComponentDefinition { get; set; }
//public SystemInfo SystemInfo { get; set; }
public SDOrganization Site { get; set; }
public SDOrganization Customer { get; set; }
public NetworkInfo NetworkInfo { get; set; }
public ICollection<NetworkInfo> NetworkInfo2 { get; set; }
[Display(Name="MAC Unique")]
public bool IsMACUnique { get; set; }
[Display(Name = "IP Unique")]
public bool IsIPUnique { get; set; }
public Nullable<double> SPEED { get; set; }
public Nullable<Int64> PROCESSORCOUNT { get; set; }
//public ResourceState AssetState { get; set; }
public TechnologyIP TechnologyIP2 { get; set; }// this is use for inserting the Network info for the VM.
[Display(Name = "IP Unique")]
public bool IsTMSIPUnique { get; set; }
[Display(Name = "MAC Unique")]
public bool IsTMSMACUnique { get; set; }
}
目前在 Visual Studio 中,我在创建视图模型的新实例时发现了以下内容,其中一些值的类型为“count=12”,而其他值的类型为“动态代理”等:-
那么什么是动态代理,为什么有些值的类型是动态代理?
【问题讨论】:
标签: asp.net-mvc entity-framework asp.net-mvc-5 entity-framework-5