If a partial class inherits from a class then all other partial classes with the same name should also inherit the same base class?

That’s a single class defined across multiple declarations, not two different classes. You only need to define the inheritance model in a single declaration, e.g.:

public class Foo { }

//Bar extends Foo
public partial class Bar : Foo { }

public partial class Bar {  }

However, if you were to try the following, you’d generate a compiler error of “Partial declarations of ‘Bar’ must not specify different base classes”:

public class Foo { }

public partial class Bar : Foo { }

public partial class Bar : object {  }

Leave a Comment