Browsing 7239 questions and answers with Jon Skeet
Is there a faster way of doing this? Yes - don't perform repeated string concatenation. That's the part that's killing your performance. Use a StringBuilder instead. It's also not even doing what you want it to - you're not using the... more 7/31/2014 11:57:46 AM
For values which only require up to 28 digits, you can use System.Decimal. The way it's designed, you don't encounter the scaling issue you do with double, where for large numbers the gap between two adjacent numbers is bigger than 1.... more 7/31/2014 9:05:11 AM
The part you've highlighted in the debugger is the inner exception. That isn't used by the CLR to determine which catch block to enter. The outer exception is just a DbUpdateException - which you haven't specified a particular catch block... more 7/31/2014 5:47:41 AM
If the method returns an IQueryable<T>, that's returning the query - not the results of the query. So calling Where will construct another query, applying a filter to the original query... still using expression trees. So when you... more 7/30/2014 8:19:01 PM
So how i can achieve this. You can't, basically - not the way you're trying. Each constructor chains to exactly one other constructor, either in the same class or the direct superclass. I suggest you create one "primary" constructor... more 7/30/2014 12:57:51 PM
The problem is Get is a virtual method in that it implements IUser.Get and so is called using execution-time dispatch - I suspect, anyway. (You haven't given us a complete program, so I've had to guess.) If you actually want "methods that... more 7/30/2014 10:54:28 AM
The exact way in which this protects you is up to the database, but there are two obvious options: The database driver could perform string interpolation and generate a SQL statement which ensures that all parameters are properly... more 7/29/2014 9:04:31 PM
You could use the Decimal constructor that takes different constituent parts. You'll need to do a bit of bitshifting to get the exponent into all the relevant sections, but that shouldn't be too hard. If you know that your value won't be... more 7/29/2014 5:48:06 PM
The value of copyCurrent doesn't change. The data within the object that copyCurrent refers to may change, but that's a different matter. Suppose you give two separate people (Alice and Bob) pieces of paper with your home address written... more 7/29/2014 5:29:47 PM
Lasse's answer is correct, but it can be made simpler: From v1.3 you can use ZonedDateTime.IsDaylightSavingTime: var zone = ...; var now = ..; var daylight = now.InZone(zone).IsDaylightSavingTime(); And from v2.0 (unreleased at the... more 7/29/2014 1:30:15 PM