Skip to content

Latest commit

 

History

History
153 lines (142 loc) · 7.3 KB

TODO.md

File metadata and controls

153 lines (142 loc) · 7.3 KB

TODO List

A list of improvements and new features to be added. Feel free to submit your own.

General Improvements

Improvements that can be made to all project templates.

  • Make use of Object Pooling code. Add note about using Object Pooling in ReadMe.html.
  • Add Google Structured Data.
  • Keep eye on HTTP Status Codes for codes I am not covering correctly.
  • Which HTTP handlers to remove link.
  • Update to Font Awesome 4.3.0 when they fix the .less files.

ASP.NET MVC 6

A new project template in addition to the existing ASP.NET MVC 5 template, targeting ASP.NET MVC 6.

  • Add Mocha JavaScript unit testing.
  • Add autoprefixer support for CSS.
  • Test 404 Not Found error page when navigating to /this-resource-does-not-exist. See this.
  • Build a HttpException for MVC 6. See here.
  • Create new tag helper versions of Open Graph and Twitter code.
  • Implement localization. See GitHub and StackOverflow
                // services.AddMvcLocalization();
    
            // application.UseCultureReplacer();
            // application.UseRequestLocalization();
        </pre>
    </li>
    <li>
        Implement CORS.
        <pre>
            // services.ConfigureCors(
            //     corsOptions =>
            //     {
            //         // TODO
            //     });
        </pre>
    </li>
    <li>
        Implement formatters.
    
        // TODO: Add the BSON input and output formatters.
    </li>
    <li>
        Consider adding an exception filter while there is no Elmah support.
        <pre>
            public class AppExceptionFilterAttribute : ExceptionFilterAttribute
            {
                private readonly ILogger _logger;
                public AppExceptionFilterAttribute(ILoggerFactory loggerfactory)
                {
                   _logger = loggerFactory.CreateLogger<AppExceptionFilterAttribute>();
                }
                public override void OnException(ExceptionContext context)
                {
                    logger.WriteError(2, "Error Occurred", context.Exception);
                    context.Result = new JsonResult(
                        new
                        {
                            context.Exception.Message,
                            context.Exception.StackTrace
                        });
                }
            }
            //Register your filter as a service (Note this filter need not be an attribute as such)
            services.AddTransient<AppExceptionFilterAttribute>();
            services.Configure<MvcOptions>(options =>
            {
                options.Filters.Add(new AppExceptionFilterAttribute());
            });
            //On the controller/action where you want to apply this filter,
            //decorate them like
            [ServiceFilter(typeof(AppExceptionFilterAttribute))]
            public class HomeController : Controller
            {
                //....
            }
        </pre>
    </li>
    

Wait for Microsoft to finish MVC 6 before adding:

  • Sign Boilerplate.Web.Mvc6 with "keyFile": "../../Key.snk"
  • CacheProfile.VaryByParam in Startup.CacheProfiles.cs
  • System.ServiceModel.SyndicationFeed. See GitHub
  • Change Boilerplate.Web.Mvc5 to use an ASP.NET 5 class library project.

Wait for third party libraries to support MVC 6:

  • NWebSec
  • Elmah
  • Glimpse

Contributions to ASP.NET 5 MVC 6 I am making to make it better.

ASP.NET MVC 6 Web API

A Web API Controller for ASP.NET MVC 6.

  • Implement Web API
                // Lets you pass a format parameter into the query string to set the response type e.g. ?format=json
                [FormatFilter]
                public class WebApiController : Controller { }
    
            // Add Web API to the request pipeline.
            ConfigureApi(application);
            
            using Microsoft.AspNet.Builder;
            using Microsoft.AspNet.Hosting;
            public partial class Startup
            {
                private const string ApiPath = "/api";
            
                /// &lt;summary&gt;
                /// Adds Web API to the request pipeline.
                /// &lt;/summary&gt;
                /// &lt;param name="application">The application.&lt;/param&gt;
                private static void ConfigureApi(IApplicationBuilder application)
                {
                    // A Web API does not need all of the features of MVC like custom error pages, CSP, Canonical URL, etc.
                    // The Map method allows us to create a new clean application under the ApiPath without all of the above
                    // features. Anyone navigating to /api will skip the MVC request pipeline and come straight here.
                    application.Map(
                        ApiPath, 
                        app =>
                        {
                            app.UseMvc();
                        });
                }
             }
    
            // Force 204 No Content response, when returning null values.
            // mvcOptions.OutputFormatters.Insert(0, new HttpNoContentOutputFormatter());
    
            // Force 406 Not Acceptable responses if the media type is not supported, instead of returning the default.
            // mvcOptions.OutputFormatters.Insert(0, new HttpNotAcceptableOutputFormatter());
        </pre>
    </li>
    <li>Add support for application/json-patch+json using the built-in <a href="https://github.com/aspnet/Mvc/issues/1976">stuff</a>.</li>
    <li>Use <a href="https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md">HAL</a> or <a href="https://github.com/kevinswiber/siren">SIREN</a>. See also <a href="http://phlyrestfully.readthedocs.org/en/latest/halprimer.html">this</a> and <a href="https://msdn.microsoft.com/en-us/magazine/jj883957.aspx">this</a> and <a href="https://github.com/JakeGinnivan/WebApi.Hal">this</a>.</li>
    

ASP.NET Identity

A new project template including the ASP.NET Identity package out of the box.

  • ASP.NET Identity Project Template.
  • Use a better (slower) encryption algorithm like bcrypt.net, zetetic.security, scrypt (See this for more information.