Add entity to nopobjectcontext

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 anni tempo fa
Hi all,
how can I add new entities to existing nopobjectxontext?

I'm developing a new plugin with its context but when I join table between different context I get linq error.
How can I add my new tables to existing nopcontext?

Thanks in advance
11 anni tempo fa
https://www.nopcommerce.com/docs/73/updating-an-existing-entity-how-to-add-a-new-property.aspx

https://www.nopcommerce.com/docs/75/plugin-with-data-access.aspx

Hope this helps

Richard
11 anni tempo fa
Thanks for reply.
I had already implemented my plugin following the instructions but when I join my new tables with nopcommerce existing tables I receive this error:

The specified LINQ expression contains references to queries that are associated with different contexts

how can I fix it?

Thanks in advance.
11 anni tempo fa
Can you define Join please. Have you created a many to many relationship between new the tables and existing tables or added new tables when the plugin install's?
11 anni tempo fa
I add a new tables with plugin install and I want to join them with order and customer table in database.
11 anni tempo fa
Hi

I would deinstall the plugin. Then create the join's in the code first as Nop work's of code first with the entity framework as we know. Then reinstal the plugin.. In the objectcontext class file you should be able to map the join's..


http://msdn.microsoft.com/en-us/magazine/hh126815.aspx

Richard
11 anni tempo fa
I can't find my post on the subject but I'm pretty sure you can't join two entities from different contexts.  Since you're in a plugin, you also can't modify the main Nop context.  I think when I ran into it I ended up just modding core files.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.