From 1a39cb0b446cff05a94c68cb26c110966b3a4876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 12 Feb 2018 22:51:36 +0300 Subject: [PATCH] Updated abp api versioning package for new changes of api versioning library. --- .../AbpApiVersioningOptionsExtensions.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpApiVersioningOptionsExtensions.cs b/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpApiVersioningOptionsExtensions.cs index c792b563d1..7a68e5df28 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpApiVersioningOptionsExtensions.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpApiVersioningOptionsExtensions.cs @@ -41,30 +41,20 @@ namespace Microsoft.Extensions.DependencyInjection { foreach (var controllerType in setting.ControllerTypes) { - var controllerBuilder = typeof(ApiVersionConventionBuilder) - .GetMethod(nameof(ApiVersionConventionBuilder.Controller), - BindingFlags.Instance | BindingFlags.Public) - .MakeGenericMethod(controllerType) - .Invoke(options.Conventions, null); + var controllerBuilder = options.Conventions.Controller(controllerType); if (setting.ApiVersions.Any()) { foreach (var apiVersion in setting.ApiVersions) { - typeof(ControllerApiVersionConventionBuilder<>) - .MakeGenericType(controllerType) - .GetMethod("HasApiVersion") - .Invoke(controllerBuilder, new object[] {apiVersion}); + controllerBuilder.HasApiVersion(apiVersion); } } else { if (!controllerType.IsDefined(typeof(ApiVersionAttribute), true)) { - typeof(ControllerApiVersionConventionBuilder<>) - .MakeGenericType(controllerType) - .GetMethod("IsApiVersionNeutral") - .Invoke(controllerBuilder, null); + controllerBuilder.IsApiVersionNeutral(); } } }