Browsing 7239 questions and answers with Jon Skeet
You can just use: if (startTime < now && now < endTime) Note that: This doesn't check the date; doesn't look like that's an issue here Depending on why you're doing this, you may want to consider intervals such as... more 6/20/2016 3:24:56 PM
No, Google App Engine "standard" environment doesn't support .NET. The "flexible" environment (currently in beta) supports custom runtimes, with the proviso that it'll be running on a Docker container. So if you are able to get your web... more 6/20/2016 3:04:20 PM
No, just like normal XML, you only need to escape the quotes when they would otherwise have a special meaning. So if your XML documentation contains an attribute and you want a double quote in the attribute value, then you'd either use an... more 6/20/2016 10:34:16 AM
As you haven't declared any constructors in B, the compiler has provided a default constructor - it's as if you'd written: public class B { public B() : base() { } // Rest of class here } So when you call new B(), the A... more 6/20/2016 6:06:01 AM
Basically, you shouldn't declare your own delegate here at all. There are no conversions between delegate types like this. You want a Func<int, double, char, string, string>, so declare one: Func<int, double, char, string,... more 6/17/2016 8:32:31 PM
My question is, why does the compiler choose my Contains() method with non-generic IEnumerable argument over Enumerable.Contains<T>() with IEnumerable<T> argument? Because it's found in the same namespace that contains the... more 6/17/2016 8:26:36 PM
It sounds like you're asking for reflection over user-defined conversion operators. You can get at those with reflection by asking for public static methods and filtering to ones called op_explicit or op_implicit, with the right parameter... more 6/17/2016 5:35:24 AM
You can use SelectMany and OfType to do this in one go: var employeeIds = employees.Items .Select(c => c.EmployeeFields) // Select the fields per employee .SelectMany(fields => fields) // Flatten to a single... more 6/16/2016 9:12:29 AM
The first problem is that choosing a floating point numeric type to represent a phone number is a terrible idea, which is likely to cause you problems all over the place. I would urge you to work out just how much effort it would take to... more 6/16/2016 8:55:03 AM
A language doesn't have an encoding. What it might have is a set of characters that are commonly used when writing in that language. Some encodings only support subsets of Unicode, but both UTF-8 and UTF-16 can encode all Unicode... more 6/16/2016 8:43:56 AM