Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C#

Custom Serialization - Part 2

Rate me:
Please Sign up or sign in to vote.
3.86/5 (11 votes)
6 Mar 2008CPOL5 min read 77.3K   624   41  
Custom Serialization in .NET
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;


namespace BusinessEntities
{
    [Serializable]
    public class Customer
    {
        [XmlAttribute("ID")]
        public string Id;

        [XmlElement("Name")]
        public string Name;

        [XmlElement("Hire")]
        public DateTime HireDate;

        [XmlElement("Rate")]
        public decimal RatePerHour;

        [XmlAttribute("Dob")]
        public DateTime Dob;

        public Customer()
        {
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Cognizant Technology Solutions
United States United States
Solution Architect working for Cognizant Technology Solutions.

Comments and Discussions