SlideShare ist ein Scribd-Unternehmen logo
1 von 6
.NET Framework 4.0 Tuples
VISIT : http://crbtech.in/Dot-Net-Training/
A Tuple is an inbuilt class sort presented in .net system 4.0. This article is extremely
valuable if the developer knows when and where to utilize it. A tuple in .
net system 4.0 will relinquish to an information structure whose component can be
classified specifically.
Tuple Insight
A Tuple is a static class and can be infused with a rundown of things that are of various
sorts. A tuple article can be made utilizing its constructor or by utilizing the technique
plant strategy called Create.
Following below are the code tests -
//Using the Generic constructor
var t = new Tuple<int, int, string, DateTime>(10, 25, “This is a tuple demo”,
DateTime.Now);
//Using the factory method Create
var t1 = Tuple.Create<int, int, string, DateTime>(10, 25, “This is a tuple demo”,
DateTime.Now);
At any moment, a tuple can be infused with 1 to 7 informative things and if the engineer needs
to include a couple of more than the route is to include another tuple object itself at the
eighth spot.
Following below is the code showing it -
//Nesting tuples
var t = new Tuple<int, int>(10, 25);
var t1 = new Tuple<string, int, int, int, int, int, int, Tuple<int, int>>(“This is a tuple demo”,
1, 2, 3, 4, 5, 6, t);
Getting to the Data from a Tuple Object
The information values provided to the tuple articles will be uncovered as Item1, Item2, and so
forth.
Following below is the code showing how to get the information from the tuple object -
class Program
{
static void Main(string[] args)
{
var t = GetEmployeeTupleObject();
Console.WriteLine(“Name: {0} {1}”, t.Item1,
t.Item2);
Console.WriteLine(“Age: {0}”, t.Item3);
Console.WriteLine(“Job Title: {0}”, t.Item4);
}
private static Tuple<string, string, int, string>
GetEmployeeTupleObject()
{
return new Tuple<string, string, int,
3. Tuple information is specifically firmly typed so
that there is no boxing or unpacking required. This
enhances the execution of the .net system.
4. On the off chance that you need to pass a worker
subtle element from a capacity as appeared in the
over segment’s specimen code in the prior .net
structure forms you may need to make an Employee
class or a struct and afterward populate the
information. Be that as it may, by utilizing the tuple
object you have accomplished it in a specific way
effortlessly and with diminished lines of code.
5. You can build the capacity limit of the tuple object
by making settled Tuples. The size is not a major
limitation as the Tuple is a reference sort yet with a
A few Limitations
1. In the event that you contrast a Tuple object and a custom article employee the tuple does not
have the qualities mapped against all around named properties like FirstName, LastName,
Age, JobTitle, and so on.; rather it uncovered them as Item1, Item2, Item3, and Item4. So
when a tuple article is passed to an outside class then the calling class ought to know in what
grouping the qualities are being passed.
2. Since the Tuple class does not actualize an Enumerable class you can’t verifiably utilize it in
a ForEach circle. On the off chance that you need to utilize ForEach still then make a custom
class acquiring Tuple and IEnumerable.
We the institute provide training in dot net field to freshers to know the reviews about our
company visit crb tech reviews.
Related Articles:
How to learn .NET Framework?
Microsoft .Net Framework 4.0| 4.5 | 4.6 for Beginners
THANK YOU!!!!
A few Limitations
1. In the event that you contrast a Tuple object and a custom article employee the tuple does not
have the qualities mapped against all around named properties like FirstName, LastName,
Age, JobTitle, and so on.; rather it uncovered them as Item1, Item2, Item3, and Item4. So
when a tuple article is passed to an outside class then the calling class ought to know in what
grouping the qualities are being passed.
2. Since the Tuple class does not actualize an Enumerable class you can’t verifiably utilize it in
a ForEach circle. On the off chance that you need to utilize ForEach still then make a custom
class acquiring Tuple and IEnumerable.
We the institute provide training in dot net field to freshers to know the reviews about our
company visit crb tech reviews.
Related Articles:
How to learn .NET Framework?
Microsoft .Net Framework 4.0| 4.5 | 4.6 for Beginners
THANK YOU!!!!

Weitere ähnliche Inhalte

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Kürzlich hochgeladen (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Dot net framework 4.0 tuples

  • 1. .NET Framework 4.0 Tuples VISIT : http://crbtech.in/Dot-Net-Training/ A Tuple is an inbuilt class sort presented in .net system 4.0. This article is extremely valuable if the developer knows when and where to utilize it. A tuple in . net system 4.0 will relinquish to an information structure whose component can be classified specifically. Tuple Insight A Tuple is a static class and can be infused with a rundown of things that are of various sorts. A tuple article can be made utilizing its constructor or by utilizing the technique plant strategy called Create. Following below are the code tests - //Using the Generic constructor var t = new Tuple<int, int, string, DateTime>(10, 25, “This is a tuple demo”, DateTime.Now);
  • 2. //Using the factory method Create var t1 = Tuple.Create<int, int, string, DateTime>(10, 25, “This is a tuple demo”, DateTime.Now); At any moment, a tuple can be infused with 1 to 7 informative things and if the engineer needs to include a couple of more than the route is to include another tuple object itself at the eighth spot. Following below is the code showing it - //Nesting tuples var t = new Tuple<int, int>(10, 25); var t1 = new Tuple<string, int, int, int, int, int, int, Tuple<int, int>>(“This is a tuple demo”, 1, 2, 3, 4, 5, 6, t); Getting to the Data from a Tuple Object The information values provided to the tuple articles will be uncovered as Item1, Item2, and so forth. Following below is the code showing how to get the information from the tuple object -
  • 3. class Program { static void Main(string[] args) { var t = GetEmployeeTupleObject(); Console.WriteLine(“Name: {0} {1}”, t.Item1, t.Item2); Console.WriteLine(“Age: {0}”, t.Item3); Console.WriteLine(“Job Title: {0}”, t.Item4); } private static Tuple<string, string, int, string> GetEmployeeTupleObject() { return new Tuple<string, string, int,
  • 4. 3. Tuple information is specifically firmly typed so that there is no boxing or unpacking required. This enhances the execution of the .net system. 4. On the off chance that you need to pass a worker subtle element from a capacity as appeared in the over segment’s specimen code in the prior .net structure forms you may need to make an Employee class or a struct and afterward populate the information. Be that as it may, by utilizing the tuple object you have accomplished it in a specific way effortlessly and with diminished lines of code. 5. You can build the capacity limit of the tuple object by making settled Tuples. The size is not a major limitation as the Tuple is a reference sort yet with a
  • 5. A few Limitations 1. In the event that you contrast a Tuple object and a custom article employee the tuple does not have the qualities mapped against all around named properties like FirstName, LastName, Age, JobTitle, and so on.; rather it uncovered them as Item1, Item2, Item3, and Item4. So when a tuple article is passed to an outside class then the calling class ought to know in what grouping the qualities are being passed. 2. Since the Tuple class does not actualize an Enumerable class you can’t verifiably utilize it in a ForEach circle. On the off chance that you need to utilize ForEach still then make a custom class acquiring Tuple and IEnumerable. We the institute provide training in dot net field to freshers to know the reviews about our company visit crb tech reviews. Related Articles: How to learn .NET Framework? Microsoft .Net Framework 4.0| 4.5 | 4.6 for Beginners THANK YOU!!!!
  • 6. A few Limitations 1. In the event that you contrast a Tuple object and a custom article employee the tuple does not have the qualities mapped against all around named properties like FirstName, LastName, Age, JobTitle, and so on.; rather it uncovered them as Item1, Item2, Item3, and Item4. So when a tuple article is passed to an outside class then the calling class ought to know in what grouping the qualities are being passed. 2. Since the Tuple class does not actualize an Enumerable class you can’t verifiably utilize it in a ForEach circle. On the off chance that you need to utilize ForEach still then make a custom class acquiring Tuple and IEnumerable. We the institute provide training in dot net field to freshers to know the reviews about our company visit crb tech reviews. Related Articles: How to learn .NET Framework? Microsoft .Net Framework 4.0| 4.5 | 4.6 for Beginners THANK YOU!!!!