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