---
title: "How to create and call tuple in MVC?"  
description: "How to create and call tuple in MVC?"  
author: "Anonymous User"  
published: 2018-04-23  
updated: 2018-04-27  
canonical: https://www.mindstick.com/forum/34475/how-to-create-and-call-tuple-in-mvc  
category: "c#"  
tags: ["asp.net mvc", "mvc", "mvc4"]  
reading_time: 1 minute  

---

# How to create and call tuple in MVC?

Hi,

I want to create [tuple](https://www.mindstick.com/forum/33652/how-to-use-tuple-in-c-sharp) in my project. And call in the [controller method](https://www.mindstick.com/forum/157312/how-to-call-a-controller-method-after-load-view-successfully-in-mvc-4).

Please give me some idea to achieve this task.

## Replies

### Reply by lukenlow lukenlow

Post is removed by the Admin.

### Reply by Hemant Patel

Hi Franco,

First, we focus on how to create Tuple in MVC:

```
 public Tuple<string, string, long> GetDetail(long id)        {           //Here you can implement all functionality of your project. And then return all value sequentially.            return new Tuple<string, string, long>("StringValue1", "StringValue2", LongValue);        }
```

You can call Tuple in your project similar to call the method of the repository.

```
var detail = Uow.PostRepository.GetDetail(id);                var value1 = detail.Item1;                var value2 = detail.Item2;                var value3 = detail.Item3;
```

You can use all three values in your application.

I hope it's informative!!!


---

Original Source: https://www.mindstick.com/forum/34475/how-to-create-and-call-tuple-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
