The instance of entity type 'manager' cannot be tracked because another instance with the same key value for {'id'} is already being tracked. When attaching existing entities, ensure that only one ent

最近在用ASP.NET CORE时遇到一些问题,现记录下:

出现上述错误,即在更新实体数据时出现的错误

services.AddDbContext<StoreContext>(c =>

            c.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));
posted @ 2019-09-02 17:41  清枫塞子  阅读(1351)  评论(0编辑  收藏  举报