Browse Source

Remove UseConventionalHttpVerbs from controller creation options.

pull/113/head
Halil İbrahim Kalkan 9 years ago
parent
commit
3a00fda900
  1. 4
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAppServiceConvention.cs
  2. 5
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpControllerAssemblySetting.cs
  3. 7
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs

4
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) protected virtual string SelectHttpMethod(ActionModel action, AbpControllerAssemblySetting configuration)
{ {
return configuration?.UseConventionalHttpVerbs == true return HttpMethodHelper.GetConventionalVerbForMethodName(action.ActionName);
? HttpMethodHelper.GetConventionalVerbForMethodName(action.ActionName)
: HttpMethodHelper.DefaultHttpVerb;
} }
protected virtual void NormalizeSelectorRoutes(string moduleName, string controllerName, ActionModel action) protected virtual void NormalizeSelectorRoutes(string moduleName, string controllerName, ActionModel action)

5
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 Assembly Assembly { get; }
public bool UseConventionalHttpVerbs { get; }
public Func<Type, bool> TypePredicate { get; set; } public Func<Type, bool> TypePredicate { get; set; }
public Action<ControllerModel> ControllerModelConfigurer { get; set; } public Action<ControllerModel> ControllerModelConfigurer { get; set; }
public AbpControllerAssemblySetting(string moduleName, Assembly assembly, bool useConventionalHttpVerbs) public AbpControllerAssemblySetting(string moduleName, Assembly assembly)
{ {
ModuleName = moduleName; ModuleName = moduleName;
Assembly = assembly; Assembly = assembly;
UseConventionalHttpVerbs = useConventionalHttpVerbs;
TypePredicate = type => true; TypePredicate = type => true;
ControllerModelConfigurer = controller => { }; ControllerModelConfigurer = controller => { };

7
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AppServiceControllerOptions.cs

@ -29,12 +29,9 @@ namespace Volo.Abp.AspNetCore.Mvc
}; };
} }
public AbpControllerAssemblySettingBuilder CreateFor( public AbpControllerAssemblySettingBuilder CreateFor(Assembly assembly, string moduleName = ModuleApiDescriptionModel.DefaultServiceModuleName)
Assembly assembly,
string moduleName = ModuleApiDescriptionModel.DefaultServiceModuleName,
bool useConventionalHttpVerbs = true)
{ {
var setting = new AbpControllerAssemblySetting(moduleName, assembly, useConventionalHttpVerbs); var setting = new AbpControllerAssemblySetting(moduleName, assembly);
ControllerAssemblySettings.Add(setting); ControllerAssemblySettings.Add(setting);
return new AbpControllerAssemblySettingBuilder(setting); return new AbpControllerAssemblySettingBuilder(setting);
} }

Loading…
Cancel
Save