Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is .Net Core 5 application organized/structured ? or how to add n-tier class library projects to .Net core Asp.Net solution? [closed]

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?

like image 636
amitthk Avatar asked Nov 17 '15 03:11

amitthk


People also ask

How do I add a class library code in Visual Studio?

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.


1 Answers

This is where I got the answer from:-

  • Upgrading ASP.NET 5 Projects between Beta Versions

How n-Layered Asp.Net 5 application is structured is available on above blog. Rick Strah's VNext sample project (AlbumViewerVNext) is located here:-

  • AlbumViewerVNext Github Repository

All thanks to Rick Strahl for his awesome blog and his sample projects.

like image 195
amitthk Avatar answered Oct 23 '22 01:10

amitthk