public abstract string GetVariableDeclaration(QueryType type, bool suppressSize);
public override string GetVariableDeclaration(QueryType type, bool suppressSize) { var sqlType = (DbQueryType)type; StringBuilder sb = new StringBuilder(); sb.Append(sqlType.SqlDbType.ToString().ToUpper()); if (sqlType.Length > 0 && !suppressSize) { if (sqlType.Length == Int32.MaxValue) { sb.Append("(max)"); } else { sb.AppendFormat("({0})", sqlType.Length); } } else if (sqlType.Precision != 0) { if (sqlType.Scale != 0) { sb.AppendFormat("({0},{1})", sqlType.Precision, sqlType.Scale); } else { sb.AppendFormat("({0})", sqlType.Precision); } } return sb.ToString(); }
public QueryParameter(string name, Type type, QueryType queryType) { this.name = name; this.type = type; this.queryType = queryType; }