From 78dd36a75700a4509ddc16efbdc4400b74e96135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 8 Nov 2020 15:52:47 +0300 Subject: [PATCH] Fix model binding type --- .../Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs | 2 +- .../AbpExtraPropertiesDictionaryModelBinderProvider.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs index 9ff444001b..8cbba0fc46 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs @@ -59,7 +59,7 @@ namespace Volo.Abp.AspNetCore.Mvc private static void AddModelBinders(MvcOptions options) { options.ModelBinderProviders.Insert(0, new AbpDateTimeModelBinderProvider()); - options.ModelBinderProviders.Insert(0, new AbpExtraPropertiesDictionaryModelBinderProvider()); + options.ModelBinderProviders.Insert(1, new AbpExtraPropertiesDictionaryModelBinderProvider()); } private static void AddMetadataProviders(MvcOptions options, IServiceCollection services) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs index 812ca30f06..2aadddbb8b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; @@ -19,7 +18,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding throw new ArgumentNullException(nameof(context)); } - if (context.Metadata.ModelType != typeof(Dictionary)) + if (context.Metadata.ModelType != typeof(ExtraPropertyDictionary)) { return null; }