Where to store custom classes in ASP.NET MVC?

A bit silly question, but if I want to create a custom class that is not a controller or model, where should I put it. In WebForms, I saved all my classes in the App_Code folder, but it seems that the classes are not stored there in MVC.

Does it even matter?

+3
source share
1 answer

There are many options. Some people simply create new folders in an ASP.NET MVC project. Others (including me) are creating completely new projects.

One of the ways I'm happy with is to break down your projects as intended ...

  • MyApp.Core <- all business logic, no data in DB / Web
  • MyApp.Infrastructure <- DB / smtp / event log
  • MyApp.UI.Web < - ASP.NET MVC
  • MyApp.Tests

...

  • MyApp.ApplicationServices
  • MyApp.UI.Controllers

ASP.NET MVC , , (Code Camp Server, Store Front, Sharp Architecture, Nerd Dinner 2 ). , ( , ..). , , / .

EDIT: ...

, , , . , , . , , , (SoC). SoC .

+10

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


All Articles