Ref returns and locals

Passing objects by reference in C# is nothing new. This is done using the ref keyword. In C# 7.0, however, you can now return objects by reference and store these objects in a local variable by reference.

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.