26
1
using System;
2
3
public class Program
4
{
5
public record struct Person(string FirstName, string LastName);
6
7
public static void Main()
8
{
9
Person p1 = new Person("Vijay", "Kumar");
10
Console.WriteLine(p1);
11
Person p2 = new Person("Vijay", "Kumar");
12
13
//Equality
14
Console.WriteLine(p1 == p2);
15
16
//Nondestructive Mutation
17
Person p3 = p1 with { LastName = "Mahesh" };
18
Console.WriteLine(p3);
19
Person p4 = p1 with { FirstName = "Siva" };
20
Console.WriteLine(p4);
21
22
//Destruction
23
var (firstName, lastName) = p1;
24
Console.WriteLine(firstName + ", " + lastName);
25
}
26
}
Cached Result
directory not found exception handled
Tasks Exception: ArgumentNullException Value cannot be null. (Parameter 'path')
Tasks Exception: ArgumentNullException Value cannot be null. (Parameter 'path')