Skip to content

Commit

Permalink
.GetPicker(propertyAlias) extension method on IPublishedContent #58 #163
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy committed Apr 7, 2017
1 parent 304c650 commit afa4471
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/nuPickers/Extensions/IPublishedContentExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace nuPickers.Extensions
{
using Umbraco.Core.Models;

public static class IPublishedContentExtensions
{
/// <summary>
/// Get a Picker model for the supplied propertyAlias on this <see cref="IPublishedContent"/>
/// </summary>
/// <param name="publishedContent"></param>
/// <param name="propertyAlias"></param>
/// <returns></returns>
public static Picker GetPicker(this IPublishedContent publishedContent, string propertyAlias)
{
return new Picker(publishedContent.Id, propertyAlias);
}
}
}
1 change: 1 addition & 0 deletions source/nuPickers/nuPickers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
<Compile Include="EmbeddedResource\EmbeddedResourceVirtualFile.cs" />
<Compile Include="EmbeddedResource\EmbeddedResourceVirtualPathProvider.cs" />
<Compile Include="EmbeddedResource\EmbeddedResourceWriter.cs" />
<Compile Include="Extensions\IPublishedContentExtensions.cs" />
<Compile Include="Extensions\UmbracoHelperExtensions.cs" />
<Compile Include="Helper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down

0 comments on commit afa4471

Please sign in to comment.