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

  • C# 7 and .NET Core Cookbook
  • Dirk Strauss
  • 118字
  • 2021-07-03 00:11:50

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.

主站蜘蛛池模板: 寻乌县| 盘锦市| 时尚| 罗源县| 新郑市| 仙桃市| 南雄市| 南华县| 榆中县| 从化市| 如皋市| 甘谷县| 日喀则市| 溆浦县| 通许县| 花莲市| 岳阳市| 湘西| 喜德县| 稷山县| 铜川市| 姜堰市| 玛曲县| 寻乌县| 昭觉县| 金坛市| 太原市| 延长县| 望江县| 英吉沙县| 东平县| 汶川县| 瓦房店市| 丰顺县| 沙坪坝区| 临安市| 凌海市| 漳平市| 新兴县| 县级市| 宜宾县|