Add new table to database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I have a problem. I must add new table to database.
Where I must add new classes ?
How to Re-create new database?
6 years ago
Percellence wrote:
I have a problem. I must add new table to database.
Where I must add new classes ?
How to Re-create new database?


This is the process to create entity in nopCommerce

Create Table Class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service
Create Controller/Models in Nop.Web or Nop.Admin for Execute service methods and pass data to view using model.
Create View in in Nop.Web or Nop.Admin for UI

Delete Settings.txt from App_Data folder and run project again.

Thanks,
Jatin
6 years ago
It's working,
Thanks...!
5 years ago
Are there any sample codes for add new table (nopcommerce 4.1)
I watched youtube videos but 4.1 is different then.

Thank u
5 years ago
Its pretty much the same as Jatin's process above
One difference is the settings file is now called dataSettings.json

One way is to find a similar table to what you require then search for / copy and paste all the code and rename
5 years ago
forefront wrote:
I have a problem. I must add new table to database.
Where I must add new classes ?
How to Re-create new database?

This is the process to create entity in nopCommerce

Create Table Class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service
Create Controller/Models in Nop.Web or Nop.Admin for Execute service methods and pass data to view using model.
Create View in in Nop.Web or Nop.Admin for UI

Delete Settings.txt from App_Data folder and run project again.

Thanks,
Jatin


It's great explanation. but it doesn't work for me with nopCommerce 4.10
I created Table class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service

I assume that is enough to create a table. Please correct me if i am wrong.

And I can't find Settints.txt

So, I cleared solution and builded again. But my table don't appeared.

Please correct me where I am wrong.

Thanks.
5 years ago
Vladyslav wrote:
I have a problem. I must add new table to database.
Where I must add new classes ?
How to Re-create new database?

This is the process to create entity in nopCommerce

Create Table Class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service
Create Controller/Models in Nop.Web or Nop.Admin for Execute service methods and pass data to view using model.
Create View in in Nop.Web or Nop.Admin for UI

Delete Settings.txt from App_Data folder and run project again.

Thanks,
Jatin

It's great explanation. but it doesn't work for me with nopCommerce 4.10
I created Table class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service

I assume that is enough to create a table. Please correct me if i am wrong.

And I can't find Settints.txt

So, I cleared solution and builded again. But my table don't appeared.

Please correct me where I am wrong.

Thanks.


You need to check https://docs.nopcommerce.com/display/en/Plugin+with+data+access

It has detailed explanation about new tables and how to access in your plugin.
5 years ago
SuperNopCommerce wrote:


You need to check https://docs.nopcommerce.com/display/en/Plugin+with+data+access

It has detailed explanation about new tables and how to access in your plugin.


This is just if you want to have access to the database with a plugin. The problem is that if i want to add a table to the default NopCommerce application than you need to add a Table Class, Create Mapping in Nop.Data and create Services and Interface for Data manipulation in Nop.Service.

But i have the same problem.
5 years ago
You should always consider if you can instead use GenericAttributes, because when you "add a table to the default NopCommerce application", it needs 'maintenance' when if/you later upgrade your nopCommerce version.
4 years ago
forefront wrote:
I have a problem. I must add new table to database.
Where I must add new classes ?
How to Re-create new database?

This is the process to create entity in nopCommerce

Create Table Class in Nop.Core
Create Mapping in Nop.Data
Create Services and Interface for Data manipulation in Nop.Service
Create Controller/Models in Nop.Web or Nop.Admin for Execute service methods and pass data to view using model.
Create View in in Nop.Web or Nop.Admin for UI

Delete Settings.txt from App_Data folder and run project again.

Thanks,
Jatin


Do we need to add table in database after the above steps?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.