Wenn Sie SubSonic 2.1/2.2 verwenden und Zugriff auf den Quellcode haben, können Sie Folgendes anwenden:
SubSonic/SqlQuery/Constraint.cs
(Eine neue Eigenschaft hinzufügen)
public bool ParameterIsTableColumn
{
get { return ParameterValue is TableSchema.TableColumn ; }
}
SubSonic/SqlQuery/SqlQuery.cs
(innerhalb der Methode SetConstraintParams)
foreach(Constraint c in qry.Constraints)
{
if (c.ConstructionFragment == "##" || c.ParameterIsTableColumn)
continue;
SubSonic/SqlQuery/SqlGenerators/ANSISqlGenerator.cs
(Innerhalb der BuildConstraintSQL-Methode)
//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));