示例
Program.cs
using System;
using ClassLibrary1;
namespace ValueTupleExample
{
public class Customer
{
public (int customerID, string customerName, string email) GetCustomerDetails()
{
return (101, "Scott", "scott@gmail.com");
}
}
class Program
{
static void Main()
{
//create object
Customer customer = new Customer();
//get details
(int customerID, string customerName, string email) = customer.GetCustomerDetails();
Console.WriteLine(customerID);
Console.WriteLine(customerName);
Console.WriteLine(email);
Console.ReadKey();
}
}
}