Hi,
you could use an Interceptor like this (but it is a hack!):
public override SqlString OnPrepareStatement(SqlString sql)
{
    var isRelevant = sql.IndexOfCaseInsensitive(" AND OptimisticLockField = 
") > -1;
    if (isRelevant)
    {
        var builder = new SqlStringBuilder(sql);
        builder.RemoveAt(sql.Count - 1);
        builder.RemoveAt(sql.Count - 2);

        builder.Add(" AND (OptimisticLockField is null or 
OptimisticLockField = ");
        builder.AddParameter();
        builder.Add(") ");

        var result = builder.ToSqlString();
        return result;
    }

    return sql;
}
Code hier eingeben...


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/df027f79-cbcb-4950-a650-b95ac3b04e1a%40googlegroups.com.

Reply via email to