Migrating project to .net core

This commit is contained in:
Elitsa Marinovska
2020-07-13 13:38:41 +02:00
parent 6e5dfbf8da
commit c0d266fc92
17 changed files with 85 additions and 261 deletions

View File

@@ -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