Use of Tuple in c#

Scenario : I have a table want to get only n number of column(2 or 3 or so on) and I don’t want create a model i.e class to store that only data,Here I need tuple

 

List<Tuple<int,string>> data =db.Resource.Select(x => new { x.Resource_ID, x.Name }).AsEnumerable().Select(x => Tuple.Create(x.Resource_ID, x.Name)).ToList();

Leave a comment