Plugin Data Access with Nop 4.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
I have a number of custom plugins that I wrote for nopCommerce 3.9 that all use EF when dealing with the database. After reading about the features of 4.3 I realize I shouldn't/can't use EF anymore and need to use Linq2Db (I believe). I haven't found any tutorials or docs online on this, so what should I do to make my old plugins compatible with 4.3?
3 years ago
TimJ012 wrote:
I have a number of custom plugins that I wrote for nopCommerce 3.9 that all use EF when dealing with the database. After reading about the features of 4.3 I realize I shouldn't/can't use EF anymore and need to use Linq2Db (I believe). I haven't found any tutorials or docs online on this, so what should I do to make my old plugins compatible with 4.3?


Hi TimJ012,

You should see some of the existing plugins that already have data access and use them as an example. See what changes the nopCommerce team has done to these plugins and simply do the same for yours.
Any linq queries should work fine but the biggest difference is that you no longer have navigation properties and you need to get them via some explicit calls.

Good luck with the upgrade!

Thanks,
Boyko
3 years ago
Hello,

In our case we have developed a large code base on top of nopCommerce using Entity Framework. We wanted the convenience of using navigation properties, lazy loading, migrations, etc. that EF gives you, not only with our entities but with the nop entities as well. So, we load our entities into the nopCommerce context and have navigation properties from our entities to nop entities such as Customer.

Now we are forced into making a rather large change or forever stuck on version 4.2. This seems like a pretty big change with a substantial impact on non-trivial plugins especially for a minor release. We just went through a laborious process to get upgraded to 4.x with .net core and didn't expect to run into this again until 5.x.

Do you have any suggestions or insights that might help us in our current situation?

Thank you.
3 years ago
Thanks, Boyko. After looking through the source code for some of the built-in plugins I figured it out. Thanks again for your help!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.