dodyg / practical-aspnetcore

Practical samples of ASP.NET Core 9 RC1, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
MIT License
9.15k stars 1.18k forks source link

Sample for splitting the area into different projects #152

Open AdrienTorris opened 5 years ago

AdrienTorris commented 5 years ago

It could be great to have a sample to show how we can split the areas of a web app into different projects, something like this: Cms.Web (ASP.NET Core web app, contains no views and no controllers) Cms.Security (.NET Standard project, considered like the "Security" area of the Cms.Web web app) Cms.Admin (.NET Standard project, considered like the "Administration" area of the Cms.Web web app) and so on...

I still search an (elegant) solution to do this, see this issue: https://github.com/aspnet/Docs/issues/9646

I keep digging...

dodyg commented 5 years ago

I remember OrchardCore CMS might be doing something like this. Let me check on this this weekend.

AdrienTorris commented 5 years ago

Ok. I'll check this and try to create a standalone version of a "distributed areas" sample.

AdrienTorris commented 5 years ago

Interesting stuff about this:

AdrienTorris commented 5 years ago

The answer is maybe here: https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnetcore-2.1

AdrienTorris commented 5 years ago

A framework allows to do this: https://github.com/ExtCore

dodyg commented 5 years ago

Nice find on Application Parts. I am gonna play with that one tomorrow.

AdrienTorris commented 5 years ago

Have fun :) For me it's play with the Razor Class Libraries.

AdrienTorris commented 5 years ago

The Razor Class Libraries are very interesting and for now it matches my needs, here a very first test: https://github.com/AdrienTorris/Entropy/tree/master/src/RazorClassLibrarySample

I could redo my RazorClassLibrarySample respecting your guidelines and submit it on this repository if you want.

dodyg commented 5 years ago

This is awesome. That would be great.

There are only two important guidelines:

AdrienTorris commented 5 years ago

Ok, I just created a Pull Request, let me know if you want that I change something in the samples I push, I'll do it with pleasure.