johnny
johnny

Reputation: 19755

Is Areas for ASP.NET Core the same as Portable Areas?

I've seen references dating back 3+ years for Portable Areas in ASP.NET MVC, but then I ran across "Areas" for ASP.NET Core.

Are these the same thing?

Side question:

Is this something that is better solved with DI if you want to create an application with modularity or plugins?

Upvotes: 2

Views: 421

Answers (1)

Dmitry Sikorsky
Dmitry Sikorsky

Reputation: 1511

Using the ASP.NET Core Application parts feature you can easily put your area's controllers/view components inside another project and then use in the main web application. It is a bit more difficult with the views and static content. I prefer to add them as resources in the same projects as area controllers are located and then implement the IFileProvider interface and assign my implementation to the IHostingEnvironment.WebRootFileProvider property.

You can use ExtCore framework to make this all automatically.

Upvotes: 1

Related Questions