Browsing 7239 questions and answers with Jon Skeet
url is the name of the parameter for the lambda expression. It's like writing a method like this: public static int Foo(string url) { Console.WriteLine(url); return 0; } Then creating a delegate from it: Func<string, int>... more 7/20/2015 9:20:36 PM
Not before C# 6... but in C# 6 you can use: using static Microsoft.SharePoint.Client.ClientObjectQueryableExtension; using SP = Microsoft.SharePoint.Client; The first of these will pull in just the static members of... more 7/20/2015 8:28:02 PM
Two options: object item = obj.getItem(i); // TODO: Fix method naming... // Note: redundancy of check/cast if (item is B) { B b = (B) item; // Use b } Or: object item = obj.getItem(i); // TODO: Fix method naming... B b = item... more 7/20/2015 7:15:22 PM
That's not a JSON array - it's just a JSON object which happens to have numbers for the properties of the response object. You can parse it as a JObject, or deserialize it to a class like this: public class Root { public int... more 7/20/2015 1:01:56 PM
Personally I would simplify your current code to: for (...) { if (bool) { bool = false; continue; } // Rest of code } ... but if you really want to do it in the if condition as a side-effect, you could... more 7/20/2015 10:29:56 AM
It sounds like you just need to return a Task<bool> then: private async Task<bool> RefreshContactsAsync() { try { ... } catch // TODO: Catch more specific exceptions { return false; } ... more 7/20/2015 9:53:06 AM
This is at least part of the problem: cmd.Parameters.Add("@InputID", SqlDbType.Int).Value = ParameterDirection.Output; That's creating an input parameter - but giving it a value which is the enum value ParameterDirection.Output. You... more 7/20/2015 6:10:39 AM
You're calling Expression.Parameter twice, which gives you different expressions. Don't do that - just call it once, and use that ParameterExpression both places you need it: var parameter =... more 7/19/2015 8:27:09 AM
"Doesn't work" is a pretty vague claim, but I suspect that the point is that if you have two threads each executing a loop with this code: field = field + 1 ... then even when it's volatile, each iteration is effectively: Read Perform... more 7/19/2015 7:28:49 AM
They have a logical index, yes - effectively the number of times you need to iterate, starting from the head, before getting to that node. That's not the same as saying "it can directly search using index of the object" - because it... more 7/19/2015 7:14:17 AM