ExecuteSingleRowOrDefault Throws Exceptions
Deantwo opened this issue · 2 comments
Deantwo commented
Same issue as #74
tik4net/tik4net/Api/ApiCommand.cs
Line 369 in 583c41e
danikf commented
Hi, I am not sure what is the problem.
Expected behavior:
0 rows - returns null
1 rows - returns the row
more than 1 rows - throws exception
Mentioned in tests: https://github.com/danikf/tik4net/blob/master/tik4net.tests/TikCommandTest.cs#L239-L262
... which is the same behavior as with standard linq ...OrDefault methods (Linq throws InvalidOperationException in this case).
( new List<string>() {"test", "test2" }.SingleOrDefault()
)
D