Change tracking and Proxy Creation is two different scenarios. If you need to disable the change tracking then you have to do it as shown below.
public class YourContext : DbContext
{
public YourContext()
{
this.Configuration.AutoDetectChangesEnabled = false;
}
}
Then you cannot do this ChangeTracker.Entries<IAuditable>().Where(x => x.State == EntityState.Modified).ToList().
If you need to disable the Proxy Creation then you have to to do it on the constructor of your context as shown below.
public class YourContext : DbContext
{
public YourContext()
{
this.Configuration.ProxyCreationEnabled = false;
}
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
}
Proxy creation mechanism is used to support lazy loading of relationships. EF will not create proxies for types where there is nothing for the proxy to do. In other words if you don't have virtual properties on your POCO classes then there is no effect either you have disabled it or not.
If you’re serializing your entities, then consider switching off proxies and lazy loading since deserializing proxies can be tricky.
You can read more about it here : Entity Framework Working with Proxies