Of course, the problem as it is not difficult to resolve. We can use the reflection to do that and that’s all. But what will happen if we have such a class: Then, you cannot simply use reflection without the knowledge about input parameters. Of course, if it cannot work with some default values like null or string.Empty then you could put some dummy information to every argument, and after that assign during the deserialization process you will assign the proper data to fields.

[EN] How to instantiate class without public constructor in C# during deserialization? « Jacek Spólnik's blog

Inne 4233 dni, 22 godziny, 34 minuty temu Paweł Łukasik 77 pokaż kod licznika zwiń

Wczytywanie artykułów...

Najaktywniejsi w tym miesiącu