Browsing 7239 questions and answers with Jon Skeet
Yes, it does nothing - but there are lots of cases where that happens in C#. It's not clear where you'd expect it to be an error, or what you'd expect it to achieve. Basically your lambda expression is a shorthand for writing a method like... more 8/17/2016 12:37:19 PM
Your XML file doesn't represent a List<people> - it contains a single people; that's what the root element is. That then contains sub-elements. You can get those easily though: XmlSerializer serializer = new... more 8/16/2016 7:28:02 PM
It's not based on the number of types that are convertible to the parameter type - it's whether any value that's valid for one overload is valid for another, due to implicit conversions. For example, there's an implicit conversion from... more 8/16/2016 4:25:03 PM
WhenAll returns a Task, but then you're awaiting that task. Awaiting a plain Task (rather than a Task<T>) gives no result. So you either want: Task claimsResult = Task.WhenAll(_claimResults); or await... more 8/16/2016 2:53:22 PM
I haven't tried this, but it looks like you could just check the modifiers for the associated keyboard device: if (e.Key == Keys.Enter && e.KeyboardDevice.Modifiers == ModifierKeys.None) { ... } more 8/16/2016 7:29:01 AM
Look at your method call expression: var matchExpr = Expression.Call(property, matchMethod, propertyExpr, valueExpr); The first argument is the target of the method call - what you're trying to call IsMatch on. Now IsMatch is declared... more 8/16/2016 6:28:40 AM
The time zone with an ID of "Central Europe Standard Time" is just the one used by central Europe... it doesn't really mean standard time. As central Europe is observing daylight savings at the moment, the offset really is UTC+2. It's... more 8/15/2016 1:07:54 PM
Async methods don't normally throw exceptions directly - they return tasks which end up being faulted. The simplest way to create such a task is to use Task.FromException. You haven't given many details in your question, but I suspect if... more 8/13/2016 2:27:56 PM
.NET has no built-in support for the zoneinfo/Olson/tz/IANA time zones (whatever you want to call them...) that are being used here. Fortunately, my Noda Time project does. Here's some code using Noda Time 1.3.2 which successfully parses... more 8/13/2016 1:53:58 PM
No, there isn't. Also, as user2357112 said in the comments, the static initializer for BaseClass is only going to run once, while initializing BaseClass. It isn't like an instance constructor, run every time an instance of a subclass is... more 8/13/2016 12:17:08 AM