首页 > 技术文章 > 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

jie566 2019-09-02 17:41 原文

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

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

services.AddDbContext<StoreContext>(c =>

            c.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));

推荐阅读