orchard cms学习点滴(一)(命令行命令)
1、codegen module HNATC.CustomAds /IncludeInSolution:true 生成模块框架
2、用codegen part 自动生成内容。前提是安装Code Generation Extensions模块。
语法:codegen part <module_name> <part_name> [/Properties:<comma-delimited list of name:type pairs>]
举例:codegen part HNATC.CustomAds AdPart /Properties: Name:string, Price:int
它会自动生成:handler, driver, model, record, display and editor shapes and updates the Placement.info file with default Content:before placement 大大减轻了工作量
注意:这时要生成HNATC.CustomAds项目,否则,下面的命令不成功
3、codegen datamigration
HNATC.CustomAds 生成Migrations.cs类
4、codegen controller HNATC.CustomAds AdsController