Guys,
What you think about to move NopCommerce data layer into reusable separated assembly?
I think, the question no.1 for most of NopCommerce users is a most efficient way to automate NopCommerce database administration.
I working on development of some kind of BackOffice application which automates such operations as update of product desctriptions, prices and etc. directly from Excel or other Storehouse management systems and faced the problem that reuse of existing NopCommerce data-layer (NopObjectContext, ProductManager and so on) is possible but not so straightforward:
1. I should reference the Nop.Common and Nop.BusinessLogic assembly to access Entity Model (which contains a lot of web-application specific code)
2. I should create data context using following hack:
NopConfig.ConnectionString = ConfigurationManager.ConnectionStrings["NopSqlConnection"].ConnectionString;
var context = ObjectContextHelper.CurrentObjectContext;
3. Usage of Managers is possible but not efficient use because each call of a manager's method causes instantiation of a new instance of DataContext (bacause HttpContext is null for Desktop application) and so on.
I suggest to:
Move whole data-layer (DataContext, data-related Managers, data validators etc...) into separate reusable assembly.
P.S. Thank you for your work!