Note: ALL code is hand written so syntax might be wrong I don't know
I want to merge two objects of a partial class generated by XSD2Code tool but not able to find out how.
I find this post which doesn't help either How to combine a Partial Class Object in C#? as Partial class I have has like hundred of properties and attributes. Also this code is copying not merging left.price = right.price;
Example
Public Method_1()
{
FruitCrate fcA = new FruitCrate();
fcA = Method_2() + Method_3();
}
Public FruitCrate Method_2()
{
FruitCrate fcB = new FruitCrate();
fcB.Name = ..
fcB..... hundred of properties..
return fcB;
}
Public FruitCrate Method_3()
{
FruitCrate fcC = new FruitCrate();
fcC.Name = ..
fcC..... hundred of properties..
return fcC;
}
This is how partial class look like,
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class FruitCrate{
private List<FruitCrate> FruitCrate;
private static System.Xml.Serialization.XmlSerializer serializer;
public FruitCrate() {
this.FruitCrateField = new List<FruitCrateField>();
}
[System.Xml.Serialization.XmlArrayAttribute(Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("FruitCrate", IsNullable=false)]
public List<FruitCrate> FruitCrate{
get {
return this.FruitCrate;
}
set {
this.FruitCrateField = value;
}
}
//soo on it's a large auto generated class