henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

SqlExpression expression cannot be null in BETA #155

Closed TroySchmidt closed 4 years ago

TroySchmidt commented 4 years ago

In previous versions the expression of SqlExpression could be null and would essentially result in no parameters and an empty whereClause. This was an easy way to provide a query or select all. Now it is throwing an error on that not being allowed to be null. That makes it harder to write logic agnostic data access methods.

henkmollema commented 4 years ago

Do you have a code sample on this?

henkmollema commented 4 years ago

I'm guessing you mean this method:

public virtual SqlExpression<TEntity> Where(Expression<Func<TEntity, bool>> expression)

Which previously allowed to pass null, e.g. expr.Where(null). I've restored this behavior.