Namespace in a project or individual project

I am trying to read about the best C # development methods. I came across people creating various class library projects as part of a solution. I develop solutions for C #, but I never create separate projects for my classes. Although some of my projects were small. To separate my namespaces, I usually create folders. Is there a good reason why I should create a separate project for my class modules?

+4
source share
1 answer

Reason for creating a separate project:

When we create a project of type Class Library, after assembly, the MSbuild process produces an assembly / dynamic linked library or .DLL file. This dll file can be referenced in any project in the same or another solution. This supports code reuse.

The general rule for web structure (ASP.Net MVC) is as follows:

  • Create a domain model project (class library project type)
  • Create data access level (class library project type)
  • Create a service level project (class library project type)
  • Create a user interface level project (ASP.Net MVC project type)

Create unit test projects (class library project type) for each project listed above.

Hope this helps.

+1
source

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


All Articles