As far as I see, I think you can just use your codes to check whether your Customer's ID is unique or not, and if all of your inputs are finished, Just use xml generator to generate the whole xml content and serialize them by exporting them into an xml file.
If you want to convert XML data to objects and back seamlessly and without pain use Searlization, to have XML into an object back that you can read through .net code - desearialize.
nagendrak
Member
1 Points
7 Posts
Class to xsd
Nov 09, 2012 03:41 PM|LINK
How do I create a C# class to enforce an element to be unique in the generated xsd (via xsd.exe)?
In below class, how do I enforce ID to be unique.
public class Customer
{
public int ID { get; set; }
public string Name {get; set;}
public DateTime? IssueDate {get; set;}
}
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Class to xsd
Nov 10, 2012 05:33 AM|LINK
Hello,
As far as I see, I think you can just use your codes to check whether your Customer's ID is unique or not, and if all of your inputs are finished, Just use xml generator to generate the whole xml content and serialize them by exporting them into an xml file.
Reguards!
Dipesh Joshi
Member
2 Points
1 Post
Re: Class to xsd
Nov 13, 2012 10:50 PM|LINK
If you want to convert XML data to objects and back seamlessly and without pain use Searlization, to have XML into an object back that you can read through .net code - desearialize.
here for how to - http://archdipesh.blogspot.com/search?q=to+convert+XML+to+simple+
http://samples.gotdotnet.com/quickstart/howto/doc/xmlserialization/rwobjfromxml.aspx