From 72400a48da085319e73fe6406b37ed17c9eab45c Mon Sep 17 00:00:00 2001 From: chenchun Date: Wed, 11 May 2022 12:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sql=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yi.Framework.ApiMicroservice.csproj | 10 ++++++++++ .../appsettings.Production.json | 2 +- .../appsettings.Staging.json | 2 +- .../yi-sqlsugar-dev.db | Bin 102400 -> 102400 bytes .../Yi.Framework.Repository/IRepository.cs | 4 ++-- .../Yi.Framework.Repository/Repository.cs | 11 ++++------- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj index f721809f..d7d79b45 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Yi.Framework.ApiMicroservice.csproj @@ -20,6 +20,16 @@ + + + + + + + Always + + + diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json index cd9cd1cd..a57d0d34 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Production.json @@ -1,5 +1,5 @@ { - "StartUrl": "http://localohost:19001", + "StartUrl": "http://*:19001", "Logging": { "LogLevel": { "Default": "Information", diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Staging.json b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Staging.json index 3898cb29..c7ae2d34 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Staging.json +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/appsettings.Staging.json @@ -1,5 +1,5 @@ { - "StartUrl": "http://localohost:19001", + "StartUrl": "http://*:19001", "Logging": { "LogLevel": { "Default": "Information", diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index d9f868085b2f5bd08932998a6a62d128bcd5c771..1027981e67f46af140bcda9ec907caf2580439ab 100644 GIT binary patch delta 237 zcmZozz}B#UZGyDmN(Kf7Ng##+*@-&FtScGxbOJV}%*o#-z{oAY$g!ER;0ynz2`m?6 zc-Uq$@J;0l;(5-qg!3HdLXIL1M{W`J%WShbgf=S*WV220PGb~MZ!(o+7Z(<0YzZt$ zOv*|1$xjC&4(A|O#}HSA5Jx8;R|O@Y$i#i>)A{omC8s9?iOC9#v!?sxGYSbA7-%Z^ zh5Gm?C@5&EOR$Msi%wq1EiqYvl}lEV!;(P^=2ir)D#a#lDGXA@3p6&~5J+%xy=LIp KZkxe)SRDW-L^rDd delta 147 zcmZozz}B#UZGyDm3I+xSNg(C~VkRJ#nW$sTx`IK^eZ|ITD;KLI*J}pX$%+Dw+Z{6)_p1W{0~9AG diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs index 390cdc8e..e58e9d27 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs @@ -21,8 +21,8 @@ namespace Yi.Framework.Repository public Task> GetListAsync(QueryCondition pars); public Task DeleteByLogicAsync(List ids); public Task UpdateIgnoreNullAsync(T entity); - public Task> UseSqlAsync(string sql); - public Task UseSqlAsync(string sql); + public Task> UseSqlAsync(string sql, object parameters = null); + public Task UseSqlAsync(string sql, object parameters = null); ISugarQueryable QueryConditionHandler(QueryCondition pars); } } diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs index cfa20c1f..6a27d7ee 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs @@ -42,24 +42,21 @@ namespace Yi.Framework.Repository /// /// /// - public async Task> UseSqlAsync(string sql) + public async Task> UseSqlAsync(string sql, object parameters = null) { - return await _Db.Ado.SqlQueryAsync(sql); + return await _Db.Ado.SqlQueryAsync(sql, parameters); } - /// /// 执行增删改sql返回状态 /// /// /// - public async Task UseSqlAsync(string sql) + public async Task UseSqlAsync(string sql, object parameters) { - return await _Db.Ado.ExecuteCommandAsync(sql)>0; + return await _Db.Ado.ExecuteCommandAsync(sql, parameters) >0; } - - /// /// 添加返回实体 ///