Modify DB Problem

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
hello
I was followed the following steps to add new entity in NopModel.edmx file but i was found and error

1. Create a new table (for example, Nop_Customer)
2. "Update model from database" for NopModel.edmx
3. Create an appropriate class in your business logic (for example, Customer)
4. Add an appropriate ObjectSet property to NopObjectContext




I was followed the steps and i was added one entity in model and also create entityset and business logic class but i was run the program an error occure in NopObjectContext and my site give an error.

  public ObjectSet<CustomerSession> CustomerSessions
        {
            get
            {
                if ((_customerSessions == null))
                {
                    _customerSessions = CreateObjectSet<CustomerSession>();======> Error in this line
                }
                return _customerSessions;
            }
        }

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

so give me a solution..

Dipesh Jade (India)
13 years ago
I am also facing the same problem

any help will be appreciated.
12 years ago
I also met this problem like you. Can you hellp me?
12 years ago
I just added an other entity model and used that where needed, it works for me.

modifying the existing data model is the real pain, I recommend its better to add an other entity model and used new one where needed.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.