Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of contract Class Serialization and deserialization in programming Development

Shulou Source: shulou.com Published: 2022-06-03 12:24:32 10月03日 Update

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!

Tags: Contracts sequences attributes articles examples analysis development programming content not much most data more tags knowledge industry accounts information information channels amount Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information Microsoft Shulou Tech Info NVidia