У меня есть этот код в моем файле конструктора 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.