#author("2022-09-01T16:17:52+08:00","default:Admin","Admin")
#author("2023-08-07T14:42:59+08:00","default:Admin","Admin")
[[SmartSql]]

&color(red){※说明:下文基于版本 2.3.7创作};

#contents

* 官网下载 [#zc2dd2d3]

 https://smartsql.net/


* VisualStudio [#nb293065]

** 工具安装 [#f15bb608]

 dotnet tool install --global SmartCode.CLI

如果提示版本问题使用下面的命令

 dotnet tool install --global SmartCode.CLI --version 2.3.7
 dotnet tool uninstall --global SmartCode.CLI

一旦安装完后,需要修改template的话,修改下面路径

 C:\Users\Administrator\.dotnet\tools\.store\smartcode.cli\2.3.7\smartcode.cli\2.3.7\tools\netcoreapp2.2\any\RazorTemplates\CSharp\API


**  运行 SmartCode.Generator (代码生成器) [#o6f776d4]

+ 编辑构建配置文件(默认:SmartCode.yml)
+ 命令行执行SmartCode命令
-- SmartCode
-- 等待提示输入配置文件路径(可选:默认程序根目录下SmartCode.yml文件)
-- 回车执行命令
+ 等待任务执行结束
+ 查看输出目录结果
+ 运行API项目,进行Swagger调试


* SmartCode.yml 配置 [#wd317001]

注意下面的 Name: DbTable 不要修改

#codeprettify{{
 XXX
DataSource:
  Name: DbTable
  Parameters:
    DbName: SHEINSaleData
    DbProvider: SqlServer
    ConnectionString: Data Source=192.168.0.10;Initial Catalog=DataDB;uid=user;pwd=user1;Integrated Security=false
}}

#hr();
コメント:
#comment_kcaptcha

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS