Browsing 7239 questions and answers with Jon Skeet
You could change your indexer signature to: public dynamic this[string name] That would then make the conversion dynamic at execution time. Personally, I prefer the cast approach though. It makes it clear that this is something that... more 3/21/2015 7:47:58 AM
Is there a way to get around this and return any cases not included in the toString()? I think you just want: return super.toString(); Then it won't call itself - it'll just use the superclass implementation. However, I'd change... more 3/21/2015 6:56:54 AM
Once that I'm iterating them, what happens with the script variable used in the foreach loop after it goes out of scope? Is that disposed? or does it remain in memory? If you mean in the ExecuteScripts method - there's nothing to... more 3/20/2015 6:10:21 PM
Not if you don't do anything with it, no. However, if you try to iterate over the results (or call Count() etc) then it will try to make a database call... and I'd expect it to then fail, because you've disposed of the context at that... more 3/20/2015 6:01:46 PM
You're observing the effects of a lifted operator. From section 7.3.7 of the C# 5 specification: Lifted operators permit predefined and user-defined operators that operate on non-nullable value types to also be used with nullable... more 3/20/2015 5:38:36 PM
group is a keyword in SQLite, so you need to escape it. Any of the following should work: "INSERT INTO usersDb (uid, agentname, `group`, ...)" "INSERT INTO usersDb (uid, agentname, [group], ...)" "INSERT INTO usersDb (uid, agentname,... more 3/20/2015 3:54:14 PM
It doesn't make sense to add a property to an array. An array consists of values, not key/value pairs. If you want something like this: [ { "title": "foo", "description": "bar" } ] then you just need an intermediate... more 3/20/2015 2:22:19 PM
This is the problem: public static B b = new B(); Static field initializers are executed before the static constructor is executed. From the C# spec section 10.5.5.1: If a static constructor (10.12) exists in the class, execution of... more 3/20/2015 1:29:52 PM
There's nothing to make it absolutely safe at compile-time from a C# language perspective, no. There are things you can do to help though. In C# 6, you can use the nameof operator, which makes it refactoring-friendly and makes it more... more 3/20/2015 1:26:02 PM
Yes, you need to provide some way of saying which value is which - just like you would for named arguments in a method call. The common conventions are: --myArg4=value4 --myArg4 value4 (Some tools prefer --, others prefer -.) There... more 3/20/2015 1:00:06 PM