From baef282b108599166fcf470bbc07ec5923519270 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 17 Jan 2020 13:53:03 +0100 Subject: [PATCH] https://github.com/umbraco/Umbraco-CMS/issues/7469 - Fixed Ambiguous extension method issue by renaming our extension method from Value to GetValue --- .../PublishedElementExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.ModelsBuilder.Embedded/PublishedElementExtensions.cs b/src/Umbraco.ModelsBuilder.Embedded/PublishedElementExtensions.cs index 33b1803169..2c22caf87d 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/PublishedElementExtensions.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/PublishedElementExtensions.cs @@ -17,13 +17,14 @@ namespace Umbraco.Web /// /// Gets the value of a property. /// - public static TValue GetValue(this TModel model, Expression> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default) + public static TValue ValueByExpression(this TModel model, Expression> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default) where TModel : IPublishedElement { var alias = GetAlias(model, property); return model.Value(alias, culture, segment, fallback, defaultValue); } + //This cannot be public due to ambiguous issue with external ModelsBuilder if we do not rename. private static string GetAlias(TModel model, Expression> property) { if (property.NodeType != ExpressionType.Lambda)