The instance of entity type cannot be tracked because another instance of this type with the same key is already being tracked

前端 未结 10 1170
一向
一向 2020-11-29 20:11

I have a Service Object Update

public bool Update(object original, object modified)
{
    var originalClient = (Client)original;
    var modifi         


        
10条回答
  •  情话喂你
    2020-11-29 20:51

    public async Task GetValue(int id)
        {
            Product Products = await _context.Products.AsNoTracking().FirstOrDefaultAsync(x => x.Id == id);
            return Products;
        }
    

    AsNoTracking()

提交回复
热议问题