Browsing 7239 questions and answers with Jon Skeet
No. Only types and methods can be generic. You can't have generic properties, events, fields, constructors or finalizers. Note that this has nothing to do with whether the containing type is generic or not - it's just a limitation of the... more 11/16/2013 9:20:24 PM
Yes - you're using MM which is a numeric month pattern. You want MMM instead, as that's "abbreviated month name". I'd also suggest explicitly specifying Locale.US in the SimpleDateFormat constructor if you know that the month and day names... more 11/16/2013 8:51:08 PM
Given this code: Arena.name = name; ... it looks like your name variable is static. (The same is true for some of your other variables too.) That means that rather than each Arena instance having a separate name, you have a single... more 11/16/2013 5:42:56 PM
This sort of the thing is the problem: new XElement("shipment", ...) You want the shipment elements to be in the "http://seller.marketplace.sears.com/oms/v5" namespace - so you need to make that explicit. That won't show up in the... more 11/16/2013 5:02:01 PM
I think you're looking for Runtime.addShutdownHook. It's not a language level construct in the way that static initializer blocks are, but I think it'll do what you want. You should be careful with shutdown hooks though - see the... more 11/16/2013 4:12:13 PM
Turned out a 'void' method can't return something. I don't know what I should use then. You should use a method which is declared to return the kind of information you want to return! When a method is void, that specifically means... more 11/16/2013 3:09:44 PM
The first problem is that you're specifying the class name before the classpath - so it thinks that -cp is one of the command line arguments to your class, rather than an argument to the JVM to say where to find classes. The second... more 11/16/2013 11:46:42 AM
Four reasons: Avoiding SQL injection attacks Avoiding problems with strings containing genuine apostrophes with no intention of causing a SQL injection attack (e.g. a last name of "O'Reilly" Avoiding string unnecessary conversions, which... more 11/16/2013 11:11:05 AM
It sounds like you just need to add another constraint to T - the Table<T>() method appears to want the new() constraint, so you'll need to add that to your constraint list too: class FeedRepository<T> :... more 11/16/2013 10:31:56 AM
You'd be best off using the Task Parallel Library introduced in .NET 4. That way you can add a continuation to execute on failure (or cancellation, or success). Call Task.ContinueWith and pass in the continuation. Tasks are generally the... more 11/16/2013 10:17:03 AM