Example Analysis of contract Class Serialization and deserialization in programming Development
I would like to share with you the sample analysis of serialization and deserialization of contract classes in programming development. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. let's learn about it!
A contract class refers to a class that inherits: DataContract. Contract classes are often used to transmit data in various services such as WCF,webService.
For all contract classes or classes that inherit contract classes, if you want the attribute to participate in serialization and deserialization, you need to mark the attribute: DataMember
Such as:
Using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.Serialization;namespace SinoOcean.Seagull2.Framework.Contracts.Fund {[DataContract] public class SubAccountItemContract {# region attribute / account / [DataMember] public string AccountNumber {get; set;} / amount / [DataMember] public decimal Money {get; set The above is all the content of the article "sample analysis of serialization and deserialization of contract classes in programming development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!