好的...我试过谷歌并没有得到很多点击。我不想滥用所以,但这是最好的地方之一要求和EF没有很好的记录。实体框架:AttachAsModified失败/混淆:)
我失败了,因为GetOriginal()在UpdateCmsProductCategory中返回null。我认为这意味着currentCmsProductCategory不在ChangeSet中。好的...我如何将它放入变更集中?
这里是序列...
我拉CmsProductCategory下跌超过WCF。 我做了修改。 我调用WCF更新方法...
public void UpdateProductCategory(CmsProductCategory category)
{
domainservice.UpdateCmsProductCategory(category);
}
其中要求域servide方法...
public virtual void UpdateCmsProductCategory(CmsProductCategory currentCmsProductCategory)
{
this.Context.AttachAsModified(currentCmsProductCategory,
this.ChangeSet.GetOriginal(currentCmsProductCategory));
}
这应该工作 - 但没有,这对我异常时GetOriginal()失败。我觉得我错过了代码修改它之间的一步,并将其传递给Wcf。
任何提示/指向良好的文档?
谢谢!