DbContext AutoDetectChangesEnabled set to false detecting changes

后端 未结 3 508
广开言路
广开言路 2020-12-02 16:48

I\'m a bit stumped. From what I\'ve read setting the DbContext.AutoDetectChangesEnabled to false should disable change tracking requiring one to ca

3条回答
  •  没有蜡笔的小新
    2020-12-02 17:13

    If someone looking for AutoDetectChangesEnabled in Entity Framework Core you can find it under ChangeTracker insted of Configuration

    Usage like:

    context.ChangeTracker.AutoDetectChangesEnabled = false;
    
    //Do something here
    context.PriceRecords.Add(newPriceRecord);
    
    context.ChangeTracker.AutoDetectChangesEnabled = true;
    

提交回复
热议问题