Started implementing new IPublishedMediaStore which will replace the notion of the legacy ExamineBackedMedia and
moving forward will open up many nice opportunities. This will be used for the media accessor in the new DynamicDocument. Renamed XmlPublishedContentStore to just DefaultPublishedContentStore. Made GetProperty an extension method for IDocument and removed from the interface as it is not needed there.
This commit is contained in:
21
src/Umbraco.Core/Models/DocumentExtensions.cs
Normal file
21
src/Umbraco.Core/Models/DocumentExtensions.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for IDocument
|
||||
/// </summary>
|
||||
public static class DocumentExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the property based on the case insensitive match of the alias
|
||||
/// </summary>
|
||||
/// <param name="d"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
public static IDocumentProperty GetProperty(this IDocument d, string alias)
|
||||
{
|
||||
return d.Properties.FirstOrDefault(p => p.Alias.InvariantEquals(alias));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@ namespace Umbraco.Core.Models
|
||||
Guid Version { get; }
|
||||
int Level { get; }
|
||||
Collection<IDocumentProperty> Properties { get; }
|
||||
IEnumerable<IDocument> Children { get; }
|
||||
IDocumentProperty GetProperty(string alias);
|
||||
IEnumerable<IDocument> Children { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user