practical-aspnetcore
practical-aspnetcore copied to clipboard
Sample for splitting the area into different projects
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...
I remember OrchardCore CMS might be doing something like this. Let me check on this this weekend.
Ok. I'll check this and try to create a standalone version of a "distributed areas" sample.
Interesting stuff about this:
- https://stackoverflow.com/questions/41191364/is-areas-for-asp-net-core-the-same-as-portable-areas
- https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnetcore-2.1
The answer is maybe here: https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnetcore-2.1
A framework allows to do this: https://github.com/ExtCore
Nice find on Application Parts. I am gonna play with that one tomorrow.
Have fun :) For me it's play with the Razor Class Libraries.
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.
This is awesome. That would be great.
There are only two important guidelines:
- Merge Startup.cs to Program.cs. This way people can see most of the code in a single page.
- Remove any extraneous files that are not relevant to the sample. This will reduce the amount of confusion people can have. Pretty much strip everything to the barest possible working example.
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.