Created
January 29, 2017 11:30
-
-
Save glcheetham/0b0fb369515f88e25a44d81ea13dec86 to your computer and use it in GitHub Desktop.
Loosely-Coupled Class Which uses APIs from UmbracoHelper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using MyProject.Models; | |
using Umbraco.Web; | |
using Our.Umbraco.Ditto; | |
namespace MyProject.Services | |
{ | |
public class ResourceService : IResourceService | |
{ | |
private ITypedPublishedContentQuery publishedContentQuery; | |
public ResourceService(ITypedPublishedContentQuery publishedContentQuery) | |
{ | |
this.publishedContentQuery = publishedContentQuery; | |
} | |
public IEnumerable<Resource> GetResources() | |
{ | |
return publishedContentQuery.TypedContentAtXPath("//item").As<Resource>(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment