Why does WebMethod in .aspx page ignore DataContract - DataMember attributes
-
18-09-2019 - |
Question
When I send back a Class, it ignores the DataContract - DataMember attributes and serializes all members of the class as well as sends the class name in the "__type" flag as well. How can I make it respect the DataMember attributes?
Solution
WebMethods use the legacy "ASMX Web Service" technology. DataContract is part of WCF.
They are totally unrelated technologies.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow