We have a customer front end built with umbraco and merchello and that works fine, but now we are trying to build a custom CRM where sales staff can access merchello customers and orders.
I set up the project with references to Umbraco.core and Mechello.core and set up the umbraco connection string in the web.config that points to our umbraco database. Everything compiles, but when I try to access MerchelloContext I get a null reference because there is no current context.
Here is the code bit that is failing...
var customerService = MerchelloContext.Current.Services.CustomerService;
var customers = customerService.GetPage(1, 20, "LastName").Items.ToList();
From what I have read, this is occurring because the context is not being initiated in the startup of the project.
So I am wondering what else I need to do other than add references for the umbraco.core and merchello.core to make this work.
Or is there a different API call that I can make to pull customer information outside or Umbraco.
How to access Merchello services from outside of umbraco
We have a customer front end built with umbraco and merchello and that works fine, but now we are trying to build a custom CRM where sales staff can access merchello customers and orders.
I set up the project with references to Umbraco.core and Mechello.core and set up the umbraco connection string in the web.config that points to our umbraco database. Everything compiles, but when I try to access MerchelloContext I get a null reference because there is no current context.
Here is the code bit that is failing...
From what I have read, this is occurring because the context is not being initiated in the startup of the project.
So I am wondering what else I need to do other than add references for the umbraco.core and merchello.core to make this work.
Or is there a different API call that I can make to pull customer information outside or Umbraco.
is working on a reply...