c# - Using reflection to instantiate a class without running its constructor -


this question has answer here:

is possible this?

i have class validation logic in constructor. general use want enforce constructor.

however, when deserializing said class, want able bypass validation logic , reserve memory space without running construction routine (like malloc in c++).the properties mapped manually using reflection, after object has been instantiated. possible in c#?

you can use formatterservices.getuninitializedobject


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -