add a new table with FK to nop v1.9?

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

I'm new to nop & entity. after many search, I figured out how to add a new table/store procedure to nop 1.9, thanks to the post at
https://www.nopcommerce.com/boards/t/6968/i-need-help-in-adding-extra-product-fields-in-database.aspx?p=3

however, I'm having a problem now that seems I could not find a solution.

I need add a new table, say nop_Customization which includes these 2 fields:


customizationId, PK
productId
.....

productId is a foreign key pointing from product table. each product could have multiple customizations.

I added the table to edmx, created the class, created the interface for customizationService, created the class for it, .... again, just follow the https://www.nopcommerce.com/boards/t/6968/i-need-help-in-adding-extra-product-fields-in-database.aspx?p=3 ,

if the table does not have the FK pointing to product table, then it works fine. I can use the customerService fine. but once I added the FK, it created error:

=======================================
Schema specified is not valid. Errors:
The relationship 'NopSolutions.NopCommerce.BusinessLogic.Data.FK_Nop_ProductVariant_Nop_Product1' was not loaded because the type 'NopSolutions.NopCommerce.BusinessLogic.Data.Product' is not available.
The following information may be useful in resolving the previous error:
The required property 'nop_Customization' does not exist on the type 'NopSolutions.NopCommerce.BusinessLogic.Products.Product'.
=======================================

anyone knows how to fix this? it seems I missed a step because of the FK.

thanks.


reader
12 years ago
BTW, the error happens in the run time. the compile is ok.


reader
12 years ago
BTW, the error happens in the run time. the compile is ok.


reader
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.