0

I am following this course on integrating an MVVM architecture with an WPF app, but using code first. For my own app I am using database first, with only a few tables.

This is my project structure, with the 3 layers, Model-View-ViewModel. In the course he creates two model classes, of course using code first in the model project, while the Data Access project handles migrations and the DbContext.

enter image description here

Now, when I use Database First, EF creates all the model classes for me, but the database context is included as well. My edmx is structured like this:

enter image description here

My question is what I need to place in which project? I'm aware that I have my view models in the UI project, which then use a data service to create a new context, but it seems I can do this all in the UI project.

1 Answer 1

0

Personally, I would keep everything in the same project, separated by namespaces (folders) for each distinct area.

In my own project I have a UI folder for Views and ViewModels, then a separate folder for Models and a bunch of other folders for things such as helper classes.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, but using namespaces instead of assemblies makes violations of the design go unnoticed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.