我正在使用 NopCommerce。
如何在 NopCommerce 中创建新表?
我已按照以下步骤操作。
创建实体类(例如 Entity.cs)
路径:
Nop/Core/Domain/Entity.cs
创建映射类(例如
EntityMap.cs
)路径:
Nop/Data/Mapping/EntityMap.cs
创建 MVC 模型(例如
EntityModel.cs
)路径:
Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs
为模型创建验证器(例如
EntityValidator.cs
)路径:
Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs
在
AutoMapperStartupTask.cs
上创建映射配置对于实体和模型路径:
Nop/Admin/Infrastructure OR Nop/Web/Infrastructure
在
MappingExtensions.cs
上应用模型和实体之间的映射路径:
Nop/Admin
或Nop/Web
创建服务类和服务接口(interface)(例如
EntityService.cs
、IEntityService.cs
)路径:
Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs
最后为给定模型创建 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/