Fixes: U4-6210 ExtensionMethodFinder doesn't work with overloaded extensions - this means overloaded extension methods for dynamic content won't work. and finalizes: U4-6209 GetGridHtml needs to be an extension on HtmlHelper not IPublishedContent so that ViewData and ModelState are inherited

This commit is contained in:
Shannon
2015-01-30 19:04:39 +11:00
parent 10990e50e6
commit f037f8541c
9 changed files with 362 additions and 302 deletions

View File

@@ -10,6 +10,7 @@ using System.Dynamic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;
using Umbraco.Core.Cache;
using Umbraco.Core.Dynamics;
using Umbraco.Core.Models;
using Umbraco.Core;
@@ -57,7 +58,11 @@ namespace Umbraco.Web.Models
// these two here have leaked in v6 and so we cannot remove them anymore
// without breaking compatibility but... TODO: remove them in v7
[Obsolete("Will be removing in future versions")]
public DynamicPublishedContentList ChildrenAsList { get { return Children; } }
[Obsolete("Will be removing in future versions")]
public int parentId { get { return PublishedContent.Parent.Id; } }
#region DynamicObject
@@ -73,7 +78,9 @@ namespace Umbraco.Web.Models
/// <returns></returns>
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
{
var attempt = DynamicInstanceHelper.TryInvokeMember(this, binder, args, new[]
var runtimeCache = ApplicationContext.Current != null ? ApplicationContext.Current.ApplicationCache.RuntimeCache : new NullCacheProvider();
var attempt = DynamicInstanceHelper.TryInvokeMember(runtimeCache, this, binder, args, new[]
{
typeof(DynamicPublishedContent)
});