官术网_书友最值得收藏!

Working with Tuples - getting started

I have come across many instances where I wanted to return more than one value from a method. As Mads Torgersen pointed out, the existing options available to developers are not optimal. C# 7.0 has, therefore, introduced Tuple types and Tuple literals to allow developers an easy way of returning multiple values from methods. Developers can also rest easy when creating Tuples. Tuples are structs, which are value types. This means that they are created locally and are passed by copying the contents. Tuples are also mutable and Tuple elements are public mutable fields. I am personally very excited about using Tuples. Let's explore Tuples in closer detail in the following recipe.

主站蜘蛛池模板: 浦江县| 鄱阳县| 星座| 岳池县| 济源市| 普陀区| 吉林省| 洪洞县| 黄龙县| 清丰县| 鄂托克旗| 达日县| 南乐县| 石渠县| 昂仁县| 西丰县| 西昌市| 岐山县| 康平县| 昭平县| 马边| 泰州市| 合川市| 庆城县| 阿拉善右旗| 南溪县| 大埔区| 保亭| 积石山| 界首市| 临沭县| 古蔺县| 罗平县| 常德市| 琼海市| 慈利县| 如皋市| 综艺| 安乡县| 南通市| 探索|