I have the follwowing code:
var trans = conn.CreateTransaction();
trans.StringSetAsync(keyValuePairs, flags: flags);
trans.SortedSetAddAsync(KeyForAllMessages(), messages.Select(m => new KeyValuePair<RedisValue, double>(m.id, m.id)).ToArray());
trans.SortedSetAddAsync(threadKey, messages.Select(m => new KeyValuePair<RedisValue, double>(m.id, m.id)).ToArray()).GetAwaiter();
return await trans.ExecuteAsync(flags);
The above code is inside an async method named:
public async Task CacheMessagesAsync(....)
VS 2013 underlines the three trans.XXX commands and display a Warning that states:
Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
Although the last command
return await trans.ExecuteAsync(flags);
means that the method wait for the above commands. Why i get the warning? Does this have anything to do with the implementation of the calls of Stackexchange.Redis Api or i'm missing something about writing proper CTP code?