Migrating project to .net core
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.ModelsBuilder;
|
||||
using Umbraco.ModelsBuilder.Embedded;
|
||||
|
||||
// same namespace as original Umbraco.Web PublishedElementExtensions
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Umbraco.Web
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods to models.
|
||||
@@ -17,11 +16,11 @@ namespace Umbraco.Web
|
||||
/// <summary>
|
||||
/// Gets the value of a property.
|
||||
/// </summary>
|
||||
public static TValue ValueFor<TModel, TValue>(this TModel model, Expression<Func<TModel, TValue>> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default)
|
||||
public static TValue ValueFor<TModel, TValue>(this TModel model, IPublishedValueFallback publishedValueFallback, Expression<Func<TModel, TValue>> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default)
|
||||
where TModel : IPublishedElement
|
||||
{
|
||||
var alias = GetAlias(model, property);
|
||||
return model.Value<TValue>(alias, culture, segment, fallback, defaultValue);
|
||||
return model.Value<TValue>(publishedValueFallback, alias, culture, segment, fallback, defaultValue);
|
||||
}
|
||||
|
||||
// fixme that one should be public so ppl can use it
|
||||
|
||||
Reference in New Issue
Block a user