You searched for new guid
. We found 22
results in 0.119 seconds.
The problem is that your type implements IQueryable<>, so the Queryable method is chosen by member lookup - so the compiler tries to create an expression tree from your lambda expression... and that's what fails. The dictionary... more
No, that shouldn't throw an exception. It will, however, set list to null - because that's what FirstOrDefault does when there are no results. If you then dereference list, you'll get a NullReferenceException. You can avoid this by just... more
I'd create a HashSet<Guid> from one of the values (any) and then check that all of the others are equal to it: // TODO: Handle the dictionary being empty var firstSet = new HashSet<Guid>(values.First().Value); var allEqual =... more
Yes, TimeZoneInfo.Local is somewhat broken on Mono. I've seen three different failure modes here: Returning a time zone which acts correctly, but has an ID of "Local" Returning a null reference Throwing an exception I don't have a good... more
If you're using LINQ to Objects, your lambda expression only needs to be convertible to a delegate. So you can use something like: var testObject = results.Select(row => { // Several statements here, as you wish int x = row.X; ... more
Each time you iterate over the result, you're going to call that Where filter... which removes the items from hashset as it goes. So after it's iterated once, hashset will no longer have any of those items, so there'll be nothing left to... more
# is invalid in a MIME boundary. From RFC 2046: The only mandatory global parameter for the "multipart" media type is the boundary parameter, which consists of 1 to 70 characters from a set of characters known to be very robust... more
Don't use Random at all for something as sensitive as this. Use RNGCryptoServiceProvider instead, which provides reasonably secure seeding. It's not as simple an API to use as Random - you basically just get bytes, potentially guaranteed... more
The problem is that if an exception is thrown, you catch it and then drop to the end of the method without returning a value. What do you want the caller to see at that point? I suspect you either want to let the exception propagate up... more
Your approach to async is fundamentally broken at the moment, because you're returning the same task for all operations... and never starting it. I don't see any "infinite loop" here - I just see you blocking on a task which can never... more