Add Cast.To(..) alternative to ApiMapper
ln.build - build0.waldrennach.l--n.de build job pending
Details
ln.build - build0.waldrennach.l--n.de build job pending
Details
parent
b5a18938c0
commit
c9eca8626b
|
@ -9,6 +9,7 @@ using ln.http.exceptions;
|
|||
using ln.http.router;
|
||||
using ln.json;
|
||||
using ln.json.mapping;
|
||||
using ln.type;
|
||||
|
||||
namespace ln.http.api
|
||||
{
|
||||
|
@ -92,6 +93,9 @@ namespace ln.http.api
|
|||
{
|
||||
if (!JSONMapper.DefaultMapper.Deserialize(jsonValue, parameterInfo.ParameterType, out arguments[n]))
|
||||
throw new BadRequestException();
|
||||
} else if (Cast.To(value, parameterInfo.ParameterType, out arguments[n]))
|
||||
{
|
||||
|
||||
} else if (value is string text)
|
||||
{
|
||||
arguments[n] = TypeDescriptor.GetConverter(parameterInfo.ParameterType).ConvertFromInvariantString(text);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>0.0.1</Version>
|
||||
<Version>0.0.2-test</Version>
|
||||
<Authors>Harald Wolff-Thobaben</Authors>
|
||||
<Company>l--n.de</Company>
|
||||
<Description>Framework to create REST like APIs</Description>
|
||||
|
@ -13,7 +13,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ln.http" Version="0.2.1-test" />
|
||||
<PackageReference Include="ln.http" Version="0.2.3-test" />
|
||||
<PackageReference Include="ln.json" Version="1.0.0" />
|
||||
<!--ProjectReference Include="..\..\ln.http\ln.http\ln.http.csproj" /-->
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Reference in New Issue