Browsing 7239 questions and answers with Jon Skeet
Basically, you need to keep a set of incomplete tasks, and repeatedly use Task.WhenAny, check the result, and keep going (having removed that task) if the result wasn't what you were looking for. For example: ISet<Task<bool>>... more 11/16/2016 7:14:21 AM
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 11/14/2016 9:29:42 PM
The super() line has already taken effect in step 4, basically. Just super(); is implicit and would usually be removed. Typically you use explicit constructor chaining for: Chaining to a constructor in the same class Providing arguments... more 11/14/2016 9:41:01 AM
Well, you'd need to look at the generated SQL, but the filtering and grouping parts are simple - it's only the counting bit that's particularly tricky. You can probably do that within the projection of the group: var start = new... more 11/14/2016 7:47:25 AM
Yup, you can just pass the list into the JObject constructor, and Json.NET will do the rest. Here's an example: using System; using System.Linq; using Newtonsoft.Json.Linq; public class Test { static void Main() { JObject... more 11/9/2016 7:41:32 PM
Just use a regular for loop - that's the simplest way of modifying the collection: for (int i = 0; i < list.Count; i++) { string url = list[i]; if (!url.StartsWith("http://")) { list[i] = "http://" + url; ... more 11/8/2016 3:04:48 PM
You're not changing the Delegate object - you're changing del to refer to a different object. It's exactly the same as with strings. Let's convert your code into the same thing but with strings: string str = "x"; str += "y"; str +=... more 11/8/2016 9:09:52 AM
Expression trees themselves are immutable. However, they can refer to things that do change, e.g. using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; public class Test { static void... more 11/5/2016 7:31:38 PM
From the documentation for notify(), emphasis mine: Wakes up a single thread that is waiting on this object's monitor. If any threads are waiting on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs... more 11/5/2016 10:15:16 AM
Fortunately, we can easily look at what ToList does now that it's open source. (Follow the link for the latest source...) I haven't seen IListProvider<T> before, but I doubt that an array implements it, which means we've basically... more 11/4/2016 7:06:10 PM