Deep understanding: serialization and deserialization of XML and objects. This article mainly describes the serialization and deserialization of XML and objects. Some simple serialization and deserialization methods will be attached for your use. Suppose we have this article in a Web project that mainly describes the serialization and deserialization of XML and objects. Some simple serialization and deserialization methods will be attached for your use.
Suppose we have two classes in a Web project:
The code is as follows:
Public class Member
{
Public string Num {get; set ;}
Public string Name {get; set ;}
}
Public class Team
{
Public string Name;
Public List Members {get; set ;}
}
Suppose we need to POST an instance of the Team class to a URL,
Of course, you can use Form to hide the field commit.
What if the Team contains 30 pieces of data?
To distinguish each Member, we need to add a suffix to the parameter name. This requires a large string of hidden domains:
The code is as follows:
@ Model Team