Browse Source

-

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
f522b95cfc
  1. 54
      Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs

54
Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs

@ -248,32 +248,6 @@ namespace SqlSugar
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()
{
this.OldCommandType = this.CommandType;
@ -1731,6 +1705,34 @@ namespace SqlSugar
var dt = this.GetDataTable(sql, parameters);
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
}
}

Loading…
Cancel
Save