Implements: U4-2824 Type Converter for string type with unit test

This commit is contained in:
Shannon
2013-09-11 11:57:15 +10:00
parent b2deb3def3
commit 9f1d212375
2 changed files with 21 additions and 1 deletions

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Core
if (input.GetType() == destinationType) return new Attempt<object>(true, input);
//check for string so that overloaders of ToString() can take advantage of the conversion.
if (destinationType == typeof(string)) return new Attempt<object>(true, input.ToString());
if (!destinationType.IsGenericType || destinationType.GetGenericTypeDefinition() != typeof(Nullable<>))
{
//TODO: Do a check for destination type being IEnumerable<T> and source type implementing IEnumerable<T> with