摘要: 问题在调用Attach(user)时报告以下错误:An entity object cannot be referenced by multiple instances of IEntityChangeTracker原因实体对象user的DbContext还没关闭,此时不允许再Attach到另一个DbContext上。Attach的实体对象,必须是脱离DbContext的管制。解决先关闭做查询的DbContext,再Attach到做更新的DbContext中。 阅读全文
posted @ 2012-05-17 13:30 深圳大漠 阅读(2552) 评论(0) 推荐(1) 编辑