Merge branch '6.2.0' into zb-cleanup

This commit is contained in:
Stephan
2013-09-11 10:39:40 +02:00
4 changed files with 26 additions and 5 deletions

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Core
if (input.GetType() == destinationType) return Attempt.Succeed(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

View File

@@ -115,7 +115,16 @@ namespace Umbraco.Tests
}
}
/// <summary>
[Test]
public virtual void CanConvertObjectToString_Using_ToString_Overload()
{
var result = new MyTestObject().TryConvertTo<string>();
Assert.IsTrue(result.Success);
Assert.AreEqual("Hello world", result.Result);
}
/// <summary>
/// Run once before each test in derived test fixtures.
/// </summary>
public override void TestSetup()
@@ -130,5 +139,13 @@ namespace Umbraco.Tests
{
return;
}
private class MyTestObject
{
public override string ToString()
{
return "Hello world";
}
}
}
}

View File

@@ -2608,8 +2608,8 @@
<Folder Include="MasterPages\" />
<Folder Include="Media\" />
<Folder Include="Scripts\" />
<Folder Include="Umbraco_client\FolderBrowser\Images\" />
<Folder Include="Umbraco_client\Tags\images\" />
<Folder Include="Umbraco_Client\FolderBrowser\Images\" />
<Folder Include="Umbraco_Client\Tags\images\" />
<Folder Include="UserControls\" />
<Folder Include="Views\MacroPartials\" />
<Folder Include="Views\Partials\" />

View File

@@ -305,8 +305,9 @@ namespace Umbraco.Web.Mvc
() => controllerType.FullName,
() => typeof(IRenderMvcController).FullName,
() => typeof(ControllerBase).FullName);
//exit as we cannnot route to the custom controller, just route to the standard one.
return def;
//we cannot route to this custom controller since it is not of the correct type so we'll continue with the defaults
// that have already been set above.
}
}