Resolved Proxy creation issue

Andy75

Member
Joined
May 29, 2020
Messages
18
Programming Experience
1-3
Hi all,
I have a project c# in FW4.0 that uses EF5.0 (DB First).
In many lines the code is used:
if (h.GetType (). Name == "Customer")
where h (Customer) is the object of my context .

Now I find myself errors because by analyzing h I find myself
System.Data.Entity.DynamicProxies.Customer_232B1622 .... etc

I have read that it is possible to disable the proxy by adding:
this.Configuration.ProxyCreationEnabled = false;

However, I get errors, the POCO classes are returned empty.

And then every time I regenerate the edmx I have to remember to go and put the line above in the .tt file.

Does anyone know how to resolve?
I would like not to touch the code because there are so many lines.

Thanks
 
Works!
Thanks.. I did not know this possibility..

I see that the keyword "is" is able to decrypt the proxy "Customer_232B1622FDEDFE545355543FEE .... etc" in "Customer"

Bye and thank you again..
 
Last edited:
Back
Top Bottom