Browsing 7239 questions and answers with Jon Skeet
The output is reasonable. Let's expand the two complicated lines into several separate statements. First snippet: // This... int val = (a = b)[3]; // Becomes... a = b; int val = a[3]; // 0 So printing a[val] will print a[0], which is... more 10/11/2014 7:35:37 AM
The problem is that your select clause is creating a new anonymous type for each item, instead of a new utrustning. You may well want something like: var queryEquipment = from utrustning in globalDBConnString.context.utrustnings ... more 10/10/2014 8:11:18 PM
Yes, the problem with the XOR operator is that unless you know that you've got all the rest of the flags, it will just flip them. So your XOR operation isn't "remove all but C" - it's "toggle the values of A and B". (So if the input was... more 10/10/2014 7:59:57 PM
I suspect the problem is the 

 in your XML. That's U+000A, or "line feed" (twice). You can validate that this is the problem by taking the XML out of it entirely. See what this does: System.out.println("Line... more 10/10/2014 7:40:54 PM
You have three problems. First, you're trying to parse the date using the format YYYY-MM-DD. That's not the format of your data, which is why parsing is failing. Second, you're expecting a Date object to retain information about a... more 10/10/2014 7:35:51 PM
Does Product have a Terms property? If so, it's pretty easy: var minMinTerm = products.SelectMany(product => product.Terms) .Min(term => term.MinTerm); The SelectMany method "flattens" a sequence - so you... more 10/10/2014 2:45:53 PM
, is the NumberGroupSeparator in the UK culture. There's no validation in terms of how many digits are in each group. So "1,2,3" would be parsed as 123, even though that's not how we'd normally expect it to be written. While it would make... more 10/10/2014 2:36:06 PM
I suspect the problem is in your formatting options. Under Options / Text Editor / C# / Formatting / Indentation, make sure that the "Indent open and close braces" box is not checked. Your code looks like it's formatted perfectly for a... more 10/10/2014 11:30:08 AM
You can just use the DateTimeOffset.LocalDateTime property: trigger.GetNextFireTimeUtc().Value.LocalDateTime From the documentation: If necessary, the LocalDateTime property converts the current DateTimeOffset object's date and time... more 10/10/2014 9:41:19 AM
If you're happy to use LINQ to XML instead (it's a generally nicer API) and if knowing the line number and position within the line is good enough, you could use IXmlLineInfo: using System; using System.Xml; using System.Xml.Linq; using... more 10/10/2014 9:35:33 AM