0

class c inherits class b and class b inherits class a.

I need to remove a property from c which is part of a.

tried this

This does not support multi level inheritance.

Josie G. Bigler
  • 367
  • 4
  • 14
Anish Karunakaran
  • 987
  • 3
  • 17
  • 39
  • 2
    If you want to expose only a limited subset of a class's properties and methods, you could write an interface which supports only that subset, implement that interface in C (or in all three classes), and then pass a reference to the interface type. In C#, inheritance means that `C` is guaranteed to be a superset of `A`, as far as declared members are concerned. When you pass a `C` to `Foo(A a)`, what do you expect to happen? – 15ee8f99-57ff-4f92-890c-b56153 Aug 29 '19 at 16:38
  • 3
    One should not inherit if one doesnt need it...It is better to have a completly new class, than having improper inheritance – Djuro Aug 29 '19 at 16:41
  • Here in my case I wish to avoid the complex properties like list and array before I pass this to an sqlite table creation method which does not support complex properties. – Anish Karunakaran Aug 29 '19 at 16:47

0 Answers0