Code First Migration in nopCommerce Plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi !

Can you explain me how use Code First Migration in a nopCommerce Plugin ?

I found this article : https://www.pronopcommerce.com/using-entity-framework-ef-code-first-migrations-in-nopcommerce-for-fast-customizations
But it talks about Migration in Nop.Data Project.

Is it the same for a nopCommerce Plugin ?

Thx for help ;)
7 years ago
I am interested in the same - the writeup describes Nop.Data changes very nicely but does not pick up changes in the plugin data. When I reproduce the setps in my plugin project I get "The EntityFramework package is not installed on project" when I enable-migrations. Am a little nervous to install EF into my plugin project - any help greatly appreciated!
6 years ago
nmancini wrote:
I am interested in the same - the writeup describes Nop.Data changes very nicely but does not pick up changes in the plugin data. When I reproduce the setps in my plugin project I get "The EntityFramework package is not installed on project" when I enable-migrations. Am a little nervous to install EF into my plugin project - any help greatly appreciated!

I got same issue, It seems that EntityFramework library was dropped in the latest version.
6 years ago
I read a blog post here: http://wittylog.com/automatic-entity-framework-migrations-in-nopcommerce-plugins

It was very helpful for me developing a plugin that utilizes EF's db migrations, so that my plugin's db tables and entities could automatically reflect any latest changes without running any db scripts, or uninstalling/reinstalling.

Hope that helps!
6 years ago
Thanks for the step-by-step procedure, I did it and it worked.

However can anybody please explain how and what mechanisms for migrations able to detect that these specific classes in Nop.Core.Domain will be created when update-database is executed?
6 years ago
Has anyone gotten this to work with a 4.0 plugin? My plugin installs just fine, but no migrations run. I followed this article exactly.

http://wittylog.com/automatic-entity-framework-migrations-in-nopcommerce-plugins
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.