Created
May 27, 2016 21:17
-
-
Save glcheetham/8abca84367c4500073026d28b2b06538 to your computer and use it in GitHub Desktop.
Class that we can inject an Umbraco IContentService into
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 Umbraco.Core; | |
using Umbraco.Core.Models; | |
using Umbraco.Core.Services; | |
namespace MyApp.Services | |
{ | |
public class MyAppContentService : Interfaces.IMyAppContentService | |
{ | |
private IContentService umbracoContentService; | |
public UkReviewContentService(IContentService umbracoContentService) | |
{ | |
this.umbracoContentService = umbracoContentService; | |
} | |
public IContent CreateContent(string name, int parentID, string contentTypeAlias) | |
{ | |
return umbracoContentService.CreateContent(name, parentID, contentTypeAlias); | |
} | |
public void Save(IContent content) | |
{ | |
umbracoContentService.Save(content); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment