Если вы используете SubSonic 2.1 / 2.2 и у вас есть доступ к источнику, вы можете применить следующее:
SubSonic / SQLQuery / Constraint.cs
(Добавить новую недвижимость)
public bool ParameterIsTableColumn
{
get { return ParameterValue is TableSchema.TableColumn ; }
}
SubSonic / SQLQuery / SqlQuery.cs
(Внутри метода SetConstraintParams)
foreach(Constraint c in qry.Constraints)
{
if (c.ConstructionFragment == "##" || c.ParameterIsTableColumn)
continue;
SubSonic / SQLQuery / SqlGenerators / ANSISqlGenerator.cs
(Внутри метода BuildConstraintSQL)
//add this at the top of the method
int currentConstraintIndex = query.Constraints.IndexOf(c);
///the statement 'c.ParameterName = ' occurs four times in this method
///use this line the first three times, and a slight variation of it on the fourth
c.ParameterName = (c.ParameterIsTableColumn ? ((TableSchema.TableColumn)c.ParameterValue).QualifiedName : String.Concat(col.ParameterName, currentConstraintIndex));