Use invariant culture when converting values

This commit is contained in:
Sipke Schoorstra 2023-05-29 14:23:41 +02:00
parent 85bff3a528
commit 7c73f93d41
2 changed files with 9 additions and 3 deletions

View file

@ -1,9 +1,14 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Default": "Information",
"Elsa.Mediator": "Warning",
"MassTransit": "Warning",
"Microsoft.Extensions.Http": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Warning",
"Microsoft.AspNetCore": "Debug"
"Microsoft.AspNetCore": "Warning",
"System.Net.Http": "Warning"
}
},
"AllowedHosts": "*",

View file

@ -1,6 +1,7 @@
using System.Collections;
using System.ComponentModel;
using System.Dynamic;
using System.Globalization;
using System.Text.Json;
using System.Text.Json.Serialization;
using Elsa.Expressions.Contracts;
@ -121,7 +122,7 @@ public static class ObjectConverter
if (targetTypeConverter.CanConvertFrom(underlyingSourceType))
return targetTypeConverter.IsValid(value)
? targetTypeConverter.ConvertFrom(value)
? targetTypeConverter.ConvertFrom(null, CultureInfo.InvariantCulture, value)
: targetType.GetDefaultValue();
var sourceTypeConverter = TypeDescriptor.GetConverter(underlyingSourceType);