Modifying DB

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

I am going to implement some logic and need to create some tables. How do you generate entity classes in NopSolutions.NopCommerce.BusinessLogic and NopObjectContext class?
13 years ago
All of them (classes andobject context) are hand crafted.
13 years ago
So can you give me a brief overview on what is required to add a new table and keys to Nop now? ie 1.7

Currently I have been going to the NopModel.edmx and doing a "update model from database"
Once the model has been updated I adjust the names to match the current Nop naming scheme
Then I add the required information to the NopObjectContext
Now I can add the required classes to the business logic

Problem is this hasn't worked too well for me as of yet what am I doing wrong, I really like this method of working with the database much faster and easier that the old method, but I could get the old method to work with out issue.

Help ;-)
13 years ago
Here is a brief tutorial:
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

That's all
13 years ago
Thanks for the quick reply.. its what I'm doing, so I guess I have to have something screwup somewhere in the logic.
13 years ago
Well its official, I'm a moron.. I had screwed up the collection in the manufacturer class for my new table/key and that was causing some ODD errors.

Thank you for the clarification it really did help.
13 years ago
Are you going to separate fields that could be generated automaticaly from "domain logic"? Handwritting slows development.
13 years ago
Sorry I'm going to have to bust out a big "?" for the last post
13 years ago
Basically I added a Product Manufacturer Part Number module
Allows you to have multiple product parts per product manufacturer
It has a single new table, admin area and new module for the product template.

This is required because I'm working with golf cart parts and a single part can work on 1/2 a dozen different models from different manufacturers.
13 years ago
nopCommerce team | a.m. wrote:
Here is a brief tutorial:
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

That's all


the shortest and most useful tutorial ever, thanks a lot.. :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.