Created
February 7, 2013 15:34
-
-
Save sitereactor/4731678 to your computer and use it in GitHub Desktop.
Basic example of a WebApi Controller getting a ContentService in the constructor.
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; | |
using System.Net.Http; | |
using System.Web.Http; | |
using Umbraco.Core; | |
using Umbraco.Core.Services; | |
namespace Example.Controllers | |
{ | |
public class WebApiUmbracoController : ApiController | |
{ | |
private IContentService _contentService; | |
public WebApiUmbracoController() | |
{ | |
_contentService = ApplicationContext.Current.Services.ContentService; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment