Modifying DB

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
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?
Hace 13 años
All of them (classes andobject context) are hand crafted.
Hace 13 años
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 ;-)
Hace 13 años
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
Hace 13 años
Thanks for the quick reply.. its what I'm doing, so I guess I have to have something screwup somewhere in the logic.
Hace 13 años
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.
Hace 13 años
Are you going to separate fields that could be generated automaticaly from "domain logic"? Handwritting slows development.
Hace 13 años
Sorry I'm going to have to bust out a big "?" for the last post
Hace 13 años
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.
Hace 13 años
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.