locked
mvvm pattern with EF & generic repository mixed in RRS feed

  • Question

  • Hi

    Am working on a WPF application with architecture as below:

    My Solution has 3 projects:

    Model class library which at simply moment has entity structure, Customer has name; dob etc..... Required are decorated as such.

    Domain class library which references my model & has my data context; a repository base; a customer repository; A databaseFactory class to get at the context

    A WPF application which has a Customer page as my view; a view model for the customer model implementing INotifyPropertyChanged interface so view can be aware of changes. The view model is having a ICustomerRepository "injected" as a contsructor parameter. This app references to both Model and Domain libraries.

    My questions:

    A) I want to be able to bring back all customers; customers with surnames =="ABC"; customers with birthdays in June etc..... Would I have methods declared in the Customerview model or would I have a command for each search declared and bind the appropriate command to the selected hyperlink/button etc...?

    B) Where would my business logic reside? Should my model have it all in there? Would my view model have a little bit?

    Any examples appreciated.

    Cheers


    Cheers

    Wednesday, October 24, 2012 9:36 PM