From afa4471ea740d7b71d0d3e0e0e0080b443b6910a Mon Sep 17 00:00:00 2001 From: Hendy Racher Date: Fri, 7 Apr 2017 23:44:25 +0100 Subject: [PATCH] .GetPicker(propertyAlias) extension method on IPublishedContent #58 #163 --- .../Extensions/IPublishedContentExtensions.cs | 18 ++++++++++++++++++ source/nuPickers/nuPickers.csproj | 1 + 2 files changed, 19 insertions(+) create mode 100644 source/nuPickers/Extensions/IPublishedContentExtensions.cs diff --git a/source/nuPickers/Extensions/IPublishedContentExtensions.cs b/source/nuPickers/Extensions/IPublishedContentExtensions.cs new file mode 100644 index 0000000..2fa31fd --- /dev/null +++ b/source/nuPickers/Extensions/IPublishedContentExtensions.cs @@ -0,0 +1,18 @@ +namespace nuPickers.Extensions +{ + using Umbraco.Core.Models; + + public static class IPublishedContentExtensions + { + /// + /// Get a Picker model for the supplied propertyAlias on this + /// + /// + /// + /// + public static Picker GetPicker(this IPublishedContent publishedContent, string propertyAlias) + { + return new Picker(publishedContent.Id, propertyAlias); + } + } +} \ No newline at end of file diff --git a/source/nuPickers/nuPickers.csproj b/source/nuPickers/nuPickers.csproj index c0ab89e..6f483ac 100644 --- a/source/nuPickers/nuPickers.csproj +++ b/source/nuPickers/nuPickers.csproj @@ -222,6 +222,7 @@ +