maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
4 additions and
2 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.ComponentModel; |
|
|
|
using System.Linq; |
|
|
|
using System.Reflection; |
|
|
|
using Microsoft.AspNetCore.Mvc.ApplicationModels; |
|
|
|
@ -35,7 +36,8 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep |
|
|
|
var idParameterModel = action.Parameters.FirstOrDefault(p => p.ParameterName == "id"); |
|
|
|
if (idParameterModel != null) |
|
|
|
{ |
|
|
|
if (TypeHelper.IsPrimitiveExtended(idParameterModel.ParameterType, includeEnums: true)) |
|
|
|
if (TypeHelper.IsPrimitiveExtended(idParameterModel.ParameterType, includeEnums: true) |
|
|
|
|| TypeDescriptor.GetConverter(idParameterModel.ParameterType).CanConvertFrom(typeof(string))) |
|
|
|
{ |
|
|
|
url += "/{id}"; |
|
|
|
} |
|
|
|
@ -156,4 +158,4 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep |
|
|
|
{ |
|
|
|
return secondaryId.ParameterName; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|