If you are using SubSonic 2.1 / 2.2 and you have access to the source, you can apply the following:
SubSonic / SQLQuery / Constraint.cs
(Add New Property)
public bool ParameterIsTableColumn
{
get { return ParameterValue is TableSchema.TableColumn ; }
}
SubSonic / SQLQuery / SqlQuery.cs
(Inside the SetConstraintParams method)
foreach(Constraint c in qry.Constraints)
{
if (c.ConstructionFragment == "##" || c.ParameterIsTableColumn)
continue;
SubSonic / SQLQuery / SqlGenerators / ANSISqlGenerator.cs
(Inside the BuildConstraintSQL Method)
int currentConstraintIndex = query.Constraints.IndexOf(c);
c.ParameterName = (c.ParameterIsTableColumn ? ((TableSchema.TableColumn)c.ParameterValue).QualifiedName : String.Concat(col.ParameterName, currentConstraintIndex));
source
share