On should throw BadExpressionException when SimpleExpression parameter is invalid #233

hmobius opened this Issue Oct 9, 2012 · 0 comments


None yet

2 participants

hmobius commented Oct 9, 2012

When writing a Join query using the On method form of either Join, OuterJoin or LeftJoin, Simple.Data will throw a variety of Exception types based on different ways to write an invalid SimpleExpression.

For example

// Throws System.ArgumentOutOfRangeException
Join(db.Genre).On(db.Albums.GenreId) // ObjectReference not SimpleExpression
Join(db.Genre).On(true) // literal not SimpleExpression

// Throws RuntimeBinderException
Join(db.Genre).On(db.Albums.GenreId = db.Genre.GenreId) // = instead of ==

Could Simple.Data throw a Simple.Data.BadExpressionException if it encounters a bad SimpleExpression parameter for On as it does for Get, Find etc.

@markrendle markrendle closed this in 3299f80 Nov 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment