Browsing 7239 questions and answers with Jon Skeet
No. The whole point of it being local to a method is that it only exists within that method. The options are: Use an instance field, i.e. make it part of the state of the object. That's unlikely to be appropriate. Use a static field,... more 3/13/2015 8:07:58 AM
Well, when you group you can specify the value you want for each element of the group: var dictionary = list.GroupBy(p => p.TypeID, p => p.NoticeID) .ToDictionary(p => p.Key, p => p.ToList()); However, I... more 3/13/2015 7:22:13 AM
Your toArray call needs to tell the list what kind of array to create: Byte[] arrayByte = super.toArray(new Byte[size()]); That can't otherwise be inferred at execution time, due to type erasure - the list doesn't "know" that it's a... more 3/13/2015 6:45:08 AM
Rather than changing the default time zone (which you're doing after creating the SimpleDateFormat) you should just set the time zone of the SimpleDateFormat: SimpleDateFormat s = new... more 3/12/2015 6:58:24 PM
It sounds like you just want: where c.CONCOM == concom && (engineer == null || c.LOPER == engineer) Alternatively, you could build up the query step by step: var query = db.RPTINQUIRies.Where(c => c.CONCOM == concom); if... more 3/12/2015 2:14:35 PM
In theory it could return a negative value - if you were using a TimeZone subclass where daylight saving time caused clocks to go back rather than forward. I very much doubt you'll see that in the wild, although I have seen something... more 3/12/2015 1:01:12 PM
I still don't know entirely what was wrong, but I now have a series of steps to at least make it easier to try things: When in doubt, reinstall dnx Blowing away the package cache can be helpful Check ~/.config/NuGet.config to ensure... more 3/12/2015 12:41:13 PM
This is not what you want: DateTime hijriDt = new DateTime(formatter.parseDateTime("1442-05-21 10-10"), iso); That's not using the Hijri calendar anywhere: Your formatter is using ISO (by default) You're parsing a date in year 1442... more 3/12/2015 11:59:54 AM
Both snippets 2 and 3 are creating a MyClass[], not a Class<MyClass>[]. The element type is determined by the first argument to Array.newInstance. If you want an array where each element is a Class reference, you need to pass in... more 3/12/2015 10:27:02 AM
I would suggest using LINQ to XML instead of XPath: XDocument doc = ...; // However you load the XML XElement element = doc.Root .Elements("Project") .Elements("Name") ... more 3/12/2015 10:06:42 AM