我的edmx设计器文件中包含此代码:
#region Navigation Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("EnviroModel", "FK_Whiteout_Field1", "Field")]
public Field Field
{
get
{
**return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Field>("EnviroModel.FK_Whiteout_Field1", "Field").Value;**
}
set
{
((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Field>("EnviroModel.FK_Whiteout_Field1", "Field").Value = value;
}
}
我在获取部分时遇到以下错误:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.