Generalized Async Return Types in C# 7.0

,
October 14, 2016 / No Comment

Ever since C# 5.0 when the async/await pattern was introduced, the only supported return types were Task<TResult>, Task, and void (the latter only in exceptional cases). The problem with this limitation is that on occasions when the result is known immediately, it is still necessary to proceed with the formality of instantiating a Task even though no task is actually required […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#

Implementing an Implicit Conversion With C# 7.0 Deconstructors

,
October 14, 2016 / No Comment

While the deconstruct syntax is interesting for its convenience in assigning to a set of variables, what I believe has far broader implications is its potential to provide an “implicit conversion operator” and in a syntax that, quite frankly, is far easier to recall than the implicit cast operator.  For example, I can provide deconstructors that map to a string […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#