The ObjectContext instance has been disposed and can no longer be used for operations that require a connection
I have this code inside my edmx designer file:
#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;
}
}
I am getting following error in get part:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
精彩评论