Reputation: 51937
I'm debugging a query with .SingleOrDefault()
that's throwing an exception "subquery is returning more than one element."
SomeValue = (from...
where ....
select ...).SingleOrDefault()
I want to see for which value it's generating this bug so I changed it to this:
SomeValue = ((from...
where ....
select ...).ToList()).ToString()
The problem is that it's not returning a string of the list but it's returning "System.Collections.Generic.List1[System.String]"
How do I get the list to a string of elements separate by commas?
Thanks.
Upvotes: 1
Views: 1568