8

I'm starting a new MVC 5 project from scratch. I'm using EF 6 (Database First) and Identity 2.0.

My solution consists of 3 different projects: Data (where I have a .edmx and my DB context), Resources (for localization purposes) and Web (the web project itself).

I'm using ViewModels for all my views, by default. Every time I create a new view, the first thing I do is add the ViewModel (if the ViewModels are connected between them, I keep them all in the same file; for example, all the ViewModels related to user accounts I keep in AccountViewModels). So far, this has made things very simple and solved several issues I was having before.

But I'm wondering, does it make sense for me to use Models at all? The only one I am using right now is the one for Identity, which is created by default and contains the ApplicationUser and ApplicationDbContext, both specific and necessary to Identity. Outside of that, it's everything ViewModels.

  • Would my Data project be considered the "Model" for my application? Thus, I am in fact using a Model, just that instead of being a bunch of classes I keep in Web\Models, it's a separate project where the "Models" (BL objects created by Entity) are stored. I think so, but I am not sure.
  • Is this a right approach, or could there be potential issues down the road? It's my first take on web programming so I would appreciate any advice.
asked Oct 2, 2015 at 10:49

1 Answer 1

9

Would my Data project be considered the "Model" for my application?

Yes, that's exactly what Model is supposed to be.

Is this a right approach

I believe it is.

or could there be potential issues down the road?

There definitely will be. But description of your architecture is so vague, that we can only guess what kind of problems will you encounter.

answered Oct 2, 2015 at 11:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.