开发者

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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜