public static IRawBuilder Append(this IRawBuilder builder, bool condition, Func <string> sqlFunc, Func <object> paramsFunc) { builder = builder ?? throw new ArgumentNullException(nameof(builder)); if (condition) { return(builder.Append(sqlFunc?.Invoke(), paramsFunc?.Invoke())); } else { return(builder); } }
public static IRawBuilder Append(this IRawBuilder builder, bool condition, Func <string> func) { builder = builder ?? throw new ArgumentNullException(nameof(builder)); func = func ?? throw new ArgumentNullException(nameof(func)); if (condition) { return(builder.Append(func.Invoke())); } else { return(builder); } }