添加sql参数
This commit is contained in:
@@ -20,6 +20,16 @@
|
||||
<None Remove="wwwrooot\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="yi-sqlsugar-dev.db" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="yi-sqlsugar-dev.db">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.DTOModel\Yi.Framework.DTOModel.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Interface\Yi.Framework.Interface.csproj" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"StartUrl": "http://localohost:19001",
|
||||
"StartUrl": "http://*:19001",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"StartUrl": "http://localohost:19001",
|
||||
"StartUrl": "http://*:19001",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
Binary file not shown.
@@ -21,8 +21,8 @@ namespace Yi.Framework.Repository
|
||||
public Task<List<T>> GetListAsync(QueryCondition pars);
|
||||
public Task<bool> DeleteByLogicAsync(List<long> ids);
|
||||
public Task<bool> UpdateIgnoreNullAsync(T entity);
|
||||
public Task<List<S>> UseSqlAsync<S>(string sql);
|
||||
public Task<bool> UseSqlAsync(string sql);
|
||||
public Task<List<S>> UseSqlAsync<S>(string sql, object parameters = null);
|
||||
public Task<bool> UseSqlAsync(string sql, object parameters = null);
|
||||
ISugarQueryable<T> QueryConditionHandler(QueryCondition pars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,24 +42,21 @@ namespace Yi.Framework.Repository
|
||||
/// <typeparam name="S"></typeparam>
|
||||
/// <param name="sql"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<S>> UseSqlAsync<S>(string sql)
|
||||
public async Task<List<S>> UseSqlAsync<S>(string sql, object parameters = null)
|
||||
{
|
||||
return await _Db.Ado.SqlQueryAsync<S>(sql);
|
||||
return await _Db.Ado.SqlQueryAsync<S>(sql, parameters);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 执行增删改sql返回状态
|
||||
/// </summary>
|
||||
/// <param name="sql"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> UseSqlAsync(string sql)
|
||||
public async Task<bool> UseSqlAsync(string sql, object parameters)
|
||||
{
|
||||
return await _Db.Ado.ExecuteCommandAsync(sql)>0;
|
||||
return await _Db.Ado.ExecuteCommandAsync(sql, parameters) >0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加返回实体
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user