Browsing 7239 questions and answers with Jon Skeet
You're creating a new EventRaiserUtility just before you call updateListEvent (which should have a capital U to follow .NET conventions, by the way; ditto updateList = UpdateList) - but you're creating a separate EventRaiserUtility in... more 10/10/2014 9:19:47 AM
The simplest approach is to use LINQ, grouping by the value, counting the number of elements in each group, and then returning the keys for groups with a single value: var singleOccurrences = array.GroupBy(x => x) ... more 10/9/2014 8:51:47 PM
It sounds like you're looking for a way to initialize the request in a single statement - otherwise just using two statements is simpler. There's a reasonably simple alternative to this, using a lambda expression - although it's pretty... more 10/9/2014 8:42:04 PM
The chances of the elapsed time being exactly the same as the required time - down to the tick - are tiny. Instead, you should see whether at least the right amount of time has passed: if (myStopwatch.Elapsed >=... more 10/9/2014 3:34:17 PM
No, that won't box value types - but it will cause a new native implementation of the method to be created (at JIT time) each time you use a different value type for TResult, whereas all reference types will share the same native code.... more 10/9/2014 3:28:22 PM
No, it isn't. Several different messages could all have the same byte[] representation. A message doesn't carry around with it any type information. The wire format indicates for each tag value what the encoding of the value is out of the... more 10/9/2014 11:48:21 AM
You haven't started the task. await will wait until it completes, but it's never going to complete if it doesn't get started. Perhaps you wanted Task.Run, which creates and starts a task? (I assume that in reality, your task does... more 10/9/2014 11:38:44 AM
But the above code always gives me a double with "." as the NumberDecimalSeparator No, it returns a double. A double is just a number. It doesn't have a NumberDecimalSeparator... only a culture does, and that's only applied when... more 10/9/2014 11:14:03 AM
No, you can't change the syntax of C#. It's baked into the language. Of course, you could check out the Roslyn compiler and build your own "not quite C#" compiler... but I'd strongly advise against it. Why would you want to create a... more 10/9/2014 11:04:25 AM
You'd need to cast the result of GetValue() to something appropriate. Is it always going to be a sequence of some class type? If so, as of C# 4 and .NET 4 you could use generic covariance: var context = new Entities(); var tableName =... more 10/9/2014 10:46:17 AM