There are 3 classes like this
public class Product
{
public string ProudctId { get; set; }
public string ProductName { get; set; }
}
public class Owner
{
public string OwnerId { get; set; }
public string OwnerName { get; set; }
}
public class Master
{
public string MasterId { get; set; }
public string MasterName { get; set; }
}
I've managed to convert these objects to XML string. Now,i want to get original objects from XML. XML looks like below:
<ProjectDetails>
<Product>
<ProductId>1</ProductId>
<ProductName>Product 1</ProductName>
</Product>
<Owner>
<OwnerId>1</OwnerId>
<OwnerName>Owner 1</OwnerName>
</Owner>
<Master>
<MasterId>1</MasterId>
<MasterName>Master 1</MasterName>
</Master>
</ProjectDetails>
Problem is, how to convert above xml into 3 objects? There is possibility that data for some of the objects may not be available in XML. e.g. Master node may or may not be available in XML. Root node name is fixed(ProjectDetails).
Any help is really appreciated.