c# - 如何在NopCommerce中添加新表?

标签 c# asp.net-mvc nopcommerce

我正在使用 NopCommerce。

如何在 NopCommerce 中创建新表?

我已按照以下步骤操作。

  1. 创建实体类(例如 Entity.cs)

    路径:Nop/Core/Domain/Entity.cs

  2. 创建映射类(例如 EntityMap.cs )

    路径:Nop/Data/Mapping/EntityMap.cs

  3. 创建 MVC 模型(例如 EntityModel.cs )

    路径:Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs

  4. 为模型创建验证器(例如 EntityValidator.cs )

    路径:Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs

  5. AutoMapperStartupTask.cs上创建映射配置对于实体和模型

    路径:Nop/Admin/Infrastructure OR Nop/Web/Infrastructure

  6. MappingExtensions.cs 上应用模型和实体之间的映射

    路径:Nop/AdminNop/Web

  7. 创建服务类和服务接口(interface)(例如 EntityService.csIEntityService.cs )

    路径:Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs

  8. 最后为给定模型创建 Controller 和 View

但是新表没有创建。那么应该是什么问题呢?

最佳答案

我想你已经在

找到了上面的东西

http://pl-developer.blogspot.in/2013/02/how-to-add-new-table-with-model-map-to.html

下面博主已经写了

as Nop Commerce uses the very first release of MVC3, database migration is not supported and you must make changes to database tables by hand. Because MVC code-first must drop and recreate your database for reflecting changes to your database.

关于c# - 如何在NopCommerce中添加新表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22140995/

相关文章:

asp.net - 从 nopcommerce 中删除购物车功能

c# - 如果过去 Y 秒内有 X 个元素,则弹出?

asp.net-mvc - 在 MVC 应用程序中配置 NHibernate 二级缓存

c# - ASP.NET MVC - 操作名称如何影响 url?

c# - "Collection was modified"尝试枚举包中的文件时出错

asp.net-mvc - Controller 继承 : how to override controller's action and force using new action when Html. 调用操作

c# - MSBuild SonarQube Runner Resharper 插件收到跳过信息错误文件不在 sonarqube 中

c# - XSockets - 自定义 Controller 未注册

c# - C# 中的泛型继承?

asp.net - nopCommerce - 是代码优先吗?