C# 7.0: Tuples Explained

,
July 27, 2017 / No Comment

Back in November, in the Connect() special issue of MSDN Magazine, I provided an overview of C# 7.0 in which I introduced tuples. Click here for the overview. In this blog I delve into tuples again, covering the full breadth of the syntax options.
To begin, let’s consider the question:
Why tuples?
On occasion, you’ll likely find it useful to […]
Read more

AUTHOR: CATEGORY: Blog

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#