Cleans up ext methods and where they are located and what they call to ensure dependencies are taken care of, cleans up Startup, moves routing appropriately

This commit is contained in:
Shannon
2020-05-12 15:18:55 +10:00
parent 4107ccdb12
commit bcaede22f1
12 changed files with 195 additions and 200 deletions

View File

@@ -20,6 +20,7 @@ using Smidge.Nuglify;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Web.Common.ApplicationModels;
using Umbraco.Web.Common.Middleware;
using Umbraco.Web.Common.ModelBinding;
namespace Umbraco.Extensions
@@ -33,6 +34,9 @@ namespace Umbraco.Extensions
/// <returns></returns>
public static IServiceCollection AddUmbracoWebComponents(this IServiceCollection services)
{
services.AddTransient<UmbracoRequestLoggingMiddleware>();
services.AddTransient<UmbracoRequestMiddleware>();
services.TryAddSingleton<UmbracoJsonModelBinder>();
services.ConfigureOptions<UmbracoMvcConfigureOptions>();
services.TryAddEnumerable(ServiceDescriptor.Transient<IApplicationModelProvider, UmbracoApiBehaviorApplicationModelProvider>());