Base solution for your next web application
Open Closed

Disable Dynamic Proxy in EF #3065


User avatar
0
bilalhaidar created

Hello, I am trying to turn off dynamic proxy creation inside the application DbContext as follows:

public OnlineSystemsDbContext()
            : base("Default")
        {
            // Turn off Dynamic Proxy
            Configuration.ProxyCreationEnabled = false;
        }

For some reason I keep on getting those long IDs attached to entities.

Do you override this setting somewhere inside the framework?

Thanks

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We don't change this value in any other place. Maybe, you can find more information on the internet.

    By the way, this action will also disable lazy loading and it might cause some problems in the project.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    bilalhaidar created

    Oh I see! Thanks a lot.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)