Some may wonder what is the difference between ValueTuple and Tuple that was released in C# 7, and you might say I have been using Tuples for a while now. Whats the difference? Some of you will remember with code like below that showcase the use of ValueTuple since .NET Framework 4.7
1 2 3 4 5 6 7 |
public Tuple<string, string> GetUserName(int userid) { var firstname = db.GetFirstname(userid); var lastname = db.GetLastname(userid); return new Tuple(firstname, lastname); } |
In order […]