From 3a00fda90089bfb1524ae8453f0336a3b6b153b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 19 Sep 2017 13:57:25 +0300 Subject: [PATCH] Remove UseConventionalHttpVerbs from controller creation options. --- .../Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs | 4 +--- .../Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs | 5 +---- .../Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs | 7 ++----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs index 5eacf0445b..66366af15b 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs @@ -226,9 +226,7 @@ namespace Volo.Abp.AspNetCore.Mvc protected virtual string SelectHttpMethod(ActionModel action, AbpControllerAssemblySetting configuration) { - return configuration?.UseConventionalHttpVerbs == true - ? HttpMethodHelper.GetConventionalVerbForMethodName(action.ActionName) - : HttpMethodHelper.DefaultHttpVerb; + return HttpMethodHelper.GetConventionalVerbForMethodName(action.ActionName); } protected virtual void NormalizeSelectorRoutes(string moduleName, string controllerName, ActionModel action) diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs index 56f4fa0142..fb10869193 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs @@ -10,17 +10,14 @@ namespace Volo.Abp.AspNetCore.Mvc public Assembly Assembly { get; } - public bool UseConventionalHttpVerbs { get; } - public Func TypePredicate { get; set; } public Action ControllerModelConfigurer { get; set; } - public AbpControllerAssemblySetting(string moduleName, Assembly assembly, bool useConventionalHttpVerbs) + public AbpControllerAssemblySetting(string moduleName, Assembly assembly) { ModuleName = moduleName; Assembly = assembly; - UseConventionalHttpVerbs = useConventionalHttpVerbs; TypePredicate = type => true; ControllerModelConfigurer = controller => { }; diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs index 659b939e3c..71359a2a59 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs @@ -29,12 +29,9 @@ namespace Volo.Abp.AspNetCore.Mvc }; } - public AbpControllerAssemblySettingBuilder CreateFor( - Assembly assembly, - string moduleName = ModuleApiDescriptionModel.DefaultServiceModuleName, - bool useConventionalHttpVerbs = true) + public AbpControllerAssemblySettingBuilder CreateFor(Assembly assembly, string moduleName = ModuleApiDescriptionModel.DefaultServiceModuleName) { - var setting = new AbpControllerAssemblySetting(moduleName, assembly, useConventionalHttpVerbs); + var setting = new AbpControllerAssemblySetting(moduleName, assembly); ControllerAssemblySettings.Add(setting); return new AbpControllerAssemblySettingBuilder(setting); }