Inheritance in the model

Topics: Questions
Jul 24, 2014 at 3:16 PM
I started using the framework today for a WPF application and tried to find this in the documentation and the examples.

I'm creating a model and want to inherited models, for example the classic Person -> Customer and Person -> Employee customer.

Since I make the customer class inherited from Modelbase, i cannot add more classe.

How to achieve this?

In the documentation I see an example for a wcf model class using KnownTypes, is this the way I've to go, or is there another solution?

Kind regards.

Jeroen
Jul 24, 2014 at 3:18 PM
In C#, you cannot inherit from multiple base classes. You can however do this:

Customer => Person => ModelBase
Employee => Person => ModelBase
Marked as answer by JeroenE on 7/25/2014 at 5:42 AM
Jul 24, 2014 at 3:23 PM
If I understand you correctly I would do?

public abstract class Person: Modelbase
{}

public class Customer: Person.
{}

And that would work?

Kind regards

Jeroen
Jul 24, 2014 at 3:23 PM
Yep!
Jul 24, 2014 at 3:25 PM
Great.

Now I can finish my model.

Thanks

Kind regards

Jeroen