Browsing 7239 questions and answers with Jon Skeet
This is the problem: new line.Split(':'); That makes it look like you're trying to create an instance of a type called line (although without specifying any arguments). You just want: private string[] patron = line.Split(':'); ...... more 7/17/2015 7:35:02 AM
My question is after a is set to null, whether it can be collected by GC at next GC trigger point even though b reference one of its fields, foo? The value of b.s happens to have been set to a.foo, but that's just copying the value.... more 7/17/2015 7:16:53 AM
If you want to check for an exact type, you can use: if (t == typeof(double)) That's fine for double, given that it's a struct, so can't be inherited from. If you want to perform a more is-like check - e.g. to check whether a type is... more 7/17/2015 5:58:39 AM
No, because you'd need to ship all the data back to the database to do the final part. Typically you have an extra Select to get just the information you need within the query (using an anonymous type if there are multiple properties you... more 7/17/2015 5:29:29 AM
The problem is that you've got two entirely independent properties called Facts for an Apple. That's a really bad idea - it makes this sort of thing really confusing. The compiler is using whichever one it has access to, based on the... more 7/16/2015 7:36:43 PM
Assuming you call toString() on the StringBuilder afterwards, I think you're just looking for Collectors.joining(), after mapping each string to a single-character substring: String result = list .stream() .map(s ->... more 7/16/2015 2:22:11 PM
tblTime.varSlotId is an integer where tblApp.varSlotId is a nullable integer. Well that's the problem then. Your two anonymous types aren't the same, and they need to be. It's probably simplest just to cast tblTime.varSlotId: join... more 7/16/2015 10:31:55 AM
Why does this error occur in early .Net versions? Because Action wasn't contravariant in .NET 2.0 (or 3.5). How can I fix it? Don't use .NET 2.0 :) I thought that modern versions of Unity were based on more recent versions of... more 7/16/2015 10:27:23 AM
I'm surprised at the nature of the error method you're getting, but not the fact that you're getting an error in the first place. You can't specify a generic argument as an expression - the aim is for it to be a compile-time specification... more 7/16/2015 6:25:01 AM
You can use the SqlFunctions class which has DateAdd and DateDiff methods, effectively as proxies to the SQL code. Your LINQ to SQL could probably call DateAdd just the once though - if you select it, you can then group by the result of... more 7/16/2015 6:16:25 AM