How to use catel ModelBase with Entity Framework Code First

Topics: Questions
Dec 28, 2012 at 3:09 PM

Hi, First of all thanks for amazing features of catel.

i am using Catel with EF Code First. in my project i have a separate class library project named DAL and all my entities and database operations combined in there.

in this way how should i use catel ModelBase?

any sample that uses EF code first are welcome.


Dec 30, 2012 at 9:50 AM


I personally have no experience with EF code first (mostly because I design a database, then use it with different clients, not only EF). I think there are enough examples available on how to use a custom base class for code-first.

A few things to keep in mind:

1) You should tweak performance, you can set LeanAndMeanModel during initialization to prevent the class from validating and raising property changed events during initialization.

2) Do you really need all functionality in your entities? You might also consider the ObservableObject.

3) If you need to convert regular properties to Catel properties, take a look at Catel.Fody.