class Program
{
public static void Print(MethodArguments args)
{
Console.WriteLine("ID = " + args.ID.ToString());
Console.WriteLine("Name = " + args.Name);
}
public static void Main(string[] args)
{
MethodArguments arguments = new MethodArguments();
arguments.ID = 20;
arguments.Name = "John";
Print(arguments);
Console.ReadKey();
}
}
答案 0 :(得分:0)
class Program
{
private static void Print((int Id, string Name) args)
{
Console.WriteLine($"ID = {args.Id.ToString()}");
Console.WriteLine($"Name = {args.Name}");
}
public static void Main(string[] args)
{
Print((20, "John"));
Console.ReadKey();
}
}