Skip to content

Commit

Permalink
Make new IDbCommand param in ISqlFormatter optional, default null
Browse files Browse the repository at this point in the history
  • Loading branch information
yellis committed May 12, 2014
1 parent 159ce00 commit 02a7de9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion StackExchange.Profiling/SqlFormatters/ISqlFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public interface ISqlFormatter
/// <summary>
/// Return SQL the way you want it to look on the in the trace. Usually used to format parameters.
/// </summary>
string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command);
string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command = null);
}
}
2 changes: 1 addition & 1 deletion StackExchange.Profiling/SqlFormatters/InlineFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public InlineFormatter(bool includeTypeInfo = false)
/// Formats the SQL in a generic friendly format, including the parameter type information
/// in a comment if it was specified in the InlineFormatter constructor
/// </summary>
public string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command)
public string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command = null)
{
if (parameters == null || parameters.Count == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static SqlServerFormatter()
/// <summary>
/// Formats the SQL in a SQL-Server friendly way, with DECLARE statements for the parameters up top.
/// </summary>
public virtual string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command)
public virtual string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command = null)
{
if (parameters == null || parameters.Count == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class VerboseSqlServerFormatter : SqlServerFormatter
/// <summary>
/// Formats the SQL in a SQL-Server friendly way, with DECLARE statements for the parameters up top.
/// </summary>
public override string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command)
public override string FormatSql(string commandText, List<SqlTimingParameter> parameters, IDbCommand command = null)
{
StringBuilder buffer = new StringBuilder();

Expand Down

0 comments on commit 02a7de9

Please sign in to comment.