I have an MVC website and I need to pull out a couple of pieces of data from an Umbraco database. I don't need any of the Umbraco views or any of that stuff. I'm new to the Umbraco Core libraries.
What I did was create a reference to the Umbraco.core dll from my web project and added the connection string to the Umbraco database in my web config. I then added a method to attempt to retrieve some data
public IContentType GetBenefits() {
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService;
var benefits = contentTypeService.GetContentType("Benefits");
return benefits;
}
ApplicationContext.Current is always null
I'm running on my local dev PC under IIS Express
Do I need to do anything else to instantiate the Umbraco connection?