I am trying to convert one of my simple Asp.Net MVC application to .Net Core. So I am trying to understand how the .Net Core Asp.Net application is organized or structured.
I understand .Net Core is not ready for Production yet. The .Net Core documentation is for most of the part not written yet (hence the curiosity).
Availability of Asp.Net 5 Beta8 was announced recently. I tried getting dnvm and dnx working on mac, there are some issues with Beta releases which get resolved after some persistence.
Now, generally we organize our .Net solution somewhat like this:-
MySolution.Core.sln
\MyProj.Web
\MyProj.Core
\MyProj.Domain
\MyProj.Service
\MyProj.Data
\etc...
So while trying to migrate the Asp.Net project to .Net Core, we wish to maintain the similar structure as above. The Your First Asp.Net 5 Application on Mac didn't really present me with any much of real life application as such. Moreover, taking inspiration from here and here, I've noticed the following structure of the application:-
MYFIRSTAPP
\src
\MyFirstApp
\bin
\wwwroot
\css
\images
\js
\lib
_references.js
\Controllers
\Views
\ViewModels
Startup.cs
project.json
hosting.ini
global.json
In project.json we define our dependencies.
So my question is, is the above structure the standard for .Net MVC 6 application? and how to add the other layers[Core,Domain,Service,Data] or class library projects to above application?
Start Visual Studio Code. In the Open Folder dialog, create a ClassLibraryProjects folder and click Select Folder (Open on macOS). Open the Terminal in Visual Studio Code by selecting View > Terminal from the main menu. The Terminal opens with the command prompt in the ClassLibraryProjects folder.
This is where I got the answer from:-
How n-Layered Asp.Net 5 application is structured is available on above blog. Rick Strah's VNext sample project (AlbumViewerVNext) is located here:-
All thanks to Rick Strahl for his awesome blog and his sample projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With