(cherry picked from commit 79bf9b753c)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
d7ede1d903
commit
a37b1075a1
@@ -8,7 +8,10 @@ using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core.Collections;
|
||||
using Formatting = Newtonsoft.Json.Formatting;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
@@ -125,6 +128,11 @@ namespace Umbraco.Core
|
||||
return Attempt.Succeed(input);
|
||||
}
|
||||
|
||||
if (target == typeof(string) && inputType == typeof(JObject))
|
||||
{
|
||||
return Attempt<object>.Succeed(JsonConvert.SerializeObject(input, Formatting.None));
|
||||
}
|
||||
|
||||
// Check for string so that overloaders of ToString() can take advantage of the conversion.
|
||||
if (target == typeof(string))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user