如何在nopcommerece中添加新表? [英] How can add a new table in nopcommerece ?

查看:114
本文介绍了如何在nopcommerece中添加新表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在nopCommerce解决方案中添加新表。我正在关注lateshtclick.com上分享的文章。



如何将新表添加到nopcommerce [ ^ ]



按照上面提到的说明,我可以在Nop.Admin项目中添加一个新模型,它工作正常。但是当我尝试在Nop.Web项目中做同样的事情时。我坚持第5步。

在第5步说,打开这条路径〜\Nop.Admin \Infrastructure。打开AutoMapperConfiguration.cs类并编写下面的代码,用于将模型映射到实体和实体到模型。

问题是,我看不到任何名为AutoMapperConfiguration.cs的文件。

我怎么能拥有它?我是否必须创建一个新文件,或者是否有任何其他类可以将模型映射到实体,将实体映射到模型。

任何帮助将不胜感激。



我尝试过:



我已经在Nop.Admin中成功添加了一个新表(管理员添加表单的界面。但我们想添加一个表单用户界面)

I have a requirement to add a new table in nopCommerce solution. I am following the article shared at lateshtclick.com.

How to add new table to nopcommerce[^]

By following the instructions mentioned, I am able to add a new model in Nop.Admin project and it works fine. But when I tried do the same in Nop.Web project. I stuck at Step 5.
In Step 5 it says, Open this path ~\Nop.Admin\Infrastructure. Open AutoMapperConfiguration.cs class and write below code for Mapping Model to Entity and Entity to Model.
The problem is, I cannot see any file named AutoMapperConfiguration.cs.
How I can have it? Do I have to create a new file or is there any other class where I can map the model to entity and entity to model.
Any help will be appreciated.

What I have tried:

I have successfully added a new table in Nop.Admin (interface of admin side add form. But we want to add a form User Interface)

推荐答案

由于我没有使用 NopCommerce 的经验,我只能给出这个提示:

转到GitHub并下载源代码:GitHub - nopSolutions / nopCommerce:免费的开源电子商务购物车(ASP.NET MVC) [ ^ ]

然后使用您感兴趣的表搜索SQL例程,例如在SQL脚本中: nopCommerce / upgrade.sql at 075a2a57fdb53cac5599db2cdea8d64fce578ba4·nopSolutions / nopCommerce·GitHub [ ^ ]
As I have no experience with NopCommerce I can only give this tip:
Go to GitHub and download the source code: GitHub - nopSolutions/nopCommerce: Free open-source ecommerce shopping cart (ASP.NET MVC)[^]
Then search for SQL routines using tables that interest you, e.g. in an SQL script: nopCommerce/upgrade.sql at 075a2a57fdb53cac5599db2cdea8d64fce578ba4 · nopSolutions/nopCommerce · GitHub[^]


you do not need to create table in nop.web.

create the table as in the article and refrence its entity from the nop.web project


这篇关于如何在nopcommerece中添加新表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆