mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
-
This commit is contained in:
parent
d1c6c2816b
commit
f522b95cfc
@ -248,32 +248,6 @@ namespace SqlSugar
|
|||||||
return Task.FromResult(UseTran(action, errorCallBack));
|
return Task.FromResult(UseTran(action, errorCallBack));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UseStoredProcedure(Action action)
|
|
||||||
{
|
|
||||||
var oldCommandType = this.CommandType;
|
|
||||||
this.CommandType = CommandType.StoredProcedure;
|
|
||||||
this.IsClearParameters = false;
|
|
||||||
if (action != null)
|
|
||||||
{
|
|
||||||
action();
|
|
||||||
}
|
|
||||||
this.CommandType = oldCommandType;
|
|
||||||
this.IsClearParameters = true;
|
|
||||||
}
|
|
||||||
public T UseStoredProcedure<T>(Func<T> action)
|
|
||||||
{
|
|
||||||
T result = default(T);
|
|
||||||
var oldCommandType = this.CommandType;
|
|
||||||
this.CommandType = CommandType.StoredProcedure;
|
|
||||||
this.IsClearParameters = false;
|
|
||||||
if (action != null)
|
|
||||||
{
|
|
||||||
result = action();
|
|
||||||
}
|
|
||||||
this.CommandType = oldCommandType;
|
|
||||||
this.IsClearParameters = true;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
public IAdo UseStoredProcedure()
|
public IAdo UseStoredProcedure()
|
||||||
{
|
{
|
||||||
this.OldCommandType = this.CommandType;
|
this.OldCommandType = this.CommandType;
|
||||||
@ -1731,6 +1705,34 @@ namespace SqlSugar
|
|||||||
var dt = this.GetDataTable(sql, parameters);
|
var dt = this.GetDataTable(sql, parameters);
|
||||||
return dt == null ? null : this.Context.Utilities.DataTableToDynamic(dt);
|
return dt == null ? null : this.Context.Utilities.DataTableToDynamic(dt);
|
||||||
}
|
}
|
||||||
|
[Obsolete]
|
||||||
|
public void UseStoredProcedure(Action action)
|
||||||
|
{
|
||||||
|
var oldCommandType = this.CommandType;
|
||||||
|
this.CommandType = CommandType.StoredProcedure;
|
||||||
|
this.IsClearParameters = false;
|
||||||
|
if (action != null)
|
||||||
|
{
|
||||||
|
action();
|
||||||
|
}
|
||||||
|
this.CommandType = oldCommandType;
|
||||||
|
this.IsClearParameters = true;
|
||||||
|
}
|
||||||
|
[Obsolete]
|
||||||
|
public T UseStoredProcedure<T>(Func<T> action)
|
||||||
|
{
|
||||||
|
T result = default(T);
|
||||||
|
var oldCommandType = this.CommandType;
|
||||||
|
this.CommandType = CommandType.StoredProcedure;
|
||||||
|
this.IsClearParameters = false;
|
||||||
|
if (action != null)
|
||||||
|
{
|
||||||
|
result = action();
|
||||||
|
}
|
||||||
|
this.CommandType = oldCommandType;
|
||||||
|
this.IsClearParameters = true;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user