Skip to content

Instantly share code, notes, and snippets.

@glcheetham
Created May 27, 2016 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glcheetham/8abca84367c4500073026d28b2b06538 to your computer and use it in GitHub Desktop.
Save glcheetham/8abca84367c4500073026d28b2b06538 to your computer and use it in GitHub Desktop.
Class that we can inject an Umbraco IContentService into
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