How do I use a namespace in ASP.NET MVC? Vaguely about Nerd Dinner

I am learning ASP.NET MVC and I like it. Nevertheless, I am very confused about the correct approach to the namespacing of my models.

When analyzing the sample NerdDinner application, I noticed that everything in the Models folder belongs to the model namespace. Data mapping classes, repositories, error rule management, etc. Relate to the same level of namespace.

I understand that this folder was inspired by frameworks such as Rails and friends, and that this is necessary to justify M in the MVC header, but; Does not the automatic model namespace destroy any possibility of writing business logic, which is both removable and portable in different systems and implementations?

Should I use a space in my business logic below this model namespace, or should I completely ignore it and classify my classes in a more structure-independent manner?

Are there any complex and good examples of ASP.NET MVC applications that would demonstrate this?

+3
source share
2 answers

I would classify your classes in the way that matters to you the most, I suspect that they used this namespace in the Nerd Dinner application example, because from the training point of view, it’s nice that the developer always sees that they are part of the application model.

Model (App.Domain) (App.Services). .Tests .

+7

- , . , - Linq-Sql.

, ° , , . , , MVC.

?

+1

Source: https://habr.com/ru/post/1706687/


All Articles