karthik25 / AddFeatureFolders

Enable feature folders for MVC controllers and views in ASP.NET Core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AddFeatureFolders

Build status

Installation

    Install-Package OdeToCode.AddFeatureFolders 

Usage

    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc()
                    .AddFeatureFolders();

            // "Features" is the default feature folder root. To override, pass along 
            // a new FeatureFolderOptions object with a different FeatureFolderName
        }

        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseDeveloperExceptionPage();
            app.UseMvcWithDefaultRoute();
        }
    }    

Don't Forget!

Add your feature folder to the list of assets to publish. In project.json:

  "publishOptions": {
    "include": [
      "wwwroot",
      "web.config",
      "Features/**/*.cshtml"
    ]
  }

About

Enable feature folders for MVC controllers and views in ASP.NET Core

License:MIT License


Languages

Language:C# 95.0%Language:PowerShell 5.0%