You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FindBy() and FindAllBy() produce different exceptions when being (erroneously) called the same way, as described below. They should throw the same exception and error message.
Suggested throw : System.ArgumentException : "FindBy\FindAllBy requires at least one column name and value to filter data by"
One column name but no column value
Calling FindByGenreId() and FindAllByGenreId() both throw System.ArgumentException : "No parameter specified".
Suggest changing message to "FindBy\FindAllBy requires a equal number of column names and values to filter data by"
No column name but one column value
Calling FindBy(1) throws System.ArgumentException : "List initializers must contain at least one initializer"
Calling FindAllBy(1) throws System.InvalidOperationException : "Sequence contains no elements"
Suggested throw : System.ArgumentException : "FindBy\FindAllBy requires a equal number of column names and values to filter data by"
One column name with column value set to null
Calling FindByGenreId(null) throws Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : "Cannot perform runtime binding on a null reference"
Calling FindAllByGenreId(null) sends correct SQL to database searching for data where GenreId is null. Returns empty data set.
Suggest FindByGenreId(null) should return null or uninitialized SimpleRecord rather than throw an exception?
The text was updated successfully, but these errors were encountered:
Calling FindBy(GenreId:null). Throws System.ArgumentException : "FindBy does not accept unnamed null argument."
Calling FindAllBy(GenreId:null) sends correct SQL to database searching for data where GenreId is null. Returns empty data set.
Suggest FindBy(GenreId:null) should either succeed and return null or uninitialized SimpleRecord OR throw the same exception as FindByGenreId(null)
FindBy() and FindAllBy() produce different exceptions when being (erroneously) called the same way, as described below. They should throw the same exception and error message.
No column names and no column values.
Calling FindBy() throws System.ArgumentException : "FindBy requires arguments."
Calling FindAllBy() throws System.InvalidOperationException : "Sequence contains no elements"
Suggested throw : System.ArgumentException : "FindBy\FindAllBy requires at least one column name and value to filter data by"
One column name but no column value
Calling FindByGenreId() and FindAllByGenreId() both throw System.ArgumentException : "No parameter specified".
Suggest changing message to "FindBy\FindAllBy requires a equal number of column names and values to filter data by"
No column name but one column value
Calling FindBy(1) throws System.ArgumentException : "List initializers must contain at least one initializer"
Calling FindAllBy(1) throws System.InvalidOperationException : "Sequence contains no elements"
Suggested throw : System.ArgumentException : "FindBy\FindAllBy requires a equal number of column names and values to filter data by"
One column name with column value set to null
Calling FindByGenreId(null) throws Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : "Cannot perform runtime binding on a null reference"
Calling FindAllByGenreId(null) sends correct SQL to database searching for data where GenreId is null. Returns empty data set.
Suggest FindByGenreId(null) should return null or uninitialized SimpleRecord rather than throw an exception?
The text was updated successfully, but these errors were encountered: