Browsing 7239 questions and answers with Jon Skeet
It's absolutely fine to have multiple await expressions in the same async method - it would be relatively useless feature otherwise. Basically, the method will execute synchronously until it reaches the first await where the awaitable... more 5/2/2016 7:12:00 AM
You're right, it does - as documented (emphasis mine): Parsing builds up the resultant instant by 'setting' the value of each parsed field from largest to smallest onto an initial instant, typically 1970-01-01T00:00Z. This design means... more 5/1/2016 11:46:51 AM
Those methods are iterators - they use yield return. They execute in a special way... the code only gets executed as you iterate over the result. So if you change the calling code to: foreach (var item in _SelectManyIteratora) { } then... more 5/1/2016 7:43:27 AM
Stream is the name of a class within TwitchAPI - you haven't declared any fields within the TwitchAPI class at all, as far as we can see. So you could use: TwitchAPI.Stream stream = new TwitchAPI.Stream(); string viewers =... more 4/30/2016 3:21:22 PM
I suspect the problem is that DEFAULT is a reserved word. Ideally, change your schema to avoid using reserved words as field names. Alternatively, quote the name: UPDATE user_inventory SET `Default`=0 WHERE `Default`=1 AND UserID=@oid more 4/30/2016 9:20:32 AM
I believe you can just use the DATE function: Returns a human-readable string of a TIMESTAMP data type in the format %Y-%m-%d. So: SELECT Id, DATE(CreatedDate) AS CreatedDate From [dataset.tablename] more 4/30/2016 6:55:59 AM
It sounds like you probably just want a Func<Model, int> parameter: public IEnumerable<int> GetData(Func<Model, int> projection) { return myData.Select(projection).Distinct(); } You could then have: var modelIds =... more 4/28/2016 10:51:44 AM
Currently you're trying to fetch the value for the user attribute of every element in the document - including the root element, for example. Two options here, which I'd probably use both of: Specify that you only want user elements,... more 4/27/2016 9:11:20 PM
Sure - I don't know how useful it is, but it's certainly doable: import java.util.*; import java.util.function.*; import java.util.stream.*; public class Test { public static void main(String[] args) { ... more 4/27/2016 9:22:01 AM
This has nothing to do with it being an array of arrays. You'll see the same error with this simpler code with a single array: String[] array; array = { "foo", "bar" }; You can't do that - an array initializer can only be used on its... more 4/26/2016 8:56:50 PM