0

I have a class and inheritance like this in my deserializable class file as shown below. I want to create another class called VendorBase which has Xml attribute called Vendor. I want my Customer class to inherit that as well. How can i achieve it?

public class Customer : CustomerBase
{
    [XmlAttribute(AttributeName = "Customer")]
    public string Customer { get; set; }

    [XmlAttribute(AttributeName = "FieldValue")]
    public string FieldValue { get; set; }

}

public class VendorBase
{
    [XmlAttribute(AttributeName = "Vendor")]
    public string Vendor { get; set; }
}
user3567026
  • 91
  • 2
  • 12
  • [C# does not support multiple inheritance](http://stackoverflow.com/questions/2456154/does-c-sharp-support-multiple-inheritance). – John Koerner Feb 05 '15 at 22:20
  • You can't without injecting `Vendor` in the inheritance chain. Why not just add the property to `Customer`? – D Stanley Feb 05 '15 at 22:59
  • Thank You Stanley. I could do that but I want my code little neater fso that the future programmers wont get confused.. I was playing with interfaces but not able to get the right way to do it. – user3567026 Feb 06 '15 at 02:36

0 Answers0