Mapping properties ModelToModel

Topics: Questions
Sep 27, 2013 at 10:27 PM

I have DAL (EF5 with CRUD repository pattern).
And i'm creating BLL now. I want to use POCO entities, but only in DAL, in BLL i've created some Business Objects and working with them, it's ok.

But now i have to create class (name it ExtBO) which contains BO (i need ID to access some data) and some other data which unique to user so i don't want store it in DB. And i wan't to save all this to file to be able work offline also.
ExtBO inherits ModelBase and contains BO as property, so if i'll do [ViewModelToModel] it's not working, but i can create properties manually like:

int ID {get { return BO.ID; }}

but what about INotifyPropertyChanged? How to resend events in ExtBO correctly?
Thank you.
Sep 27, 2013 at 10:35 PM
You should do the mapping of ExtBO => BO yourself. That is outside the scope of Catel. However, the mappings between ExtBO and the view model can be done automatically because your ExtBO will implement INotifyPropertyChanged (because it derives from ModelBase).