-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (27 loc) · 779 Bytes
/
Program.cs
File metadata and controls
37 lines (27 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using CSTypes;
using CSTypes.Records;
// Class object
var u1 = new User("kdjf93487jdhf")
{
Name = "Ahmad",
Email = "ahmad@example.com"
};
var u2 = new User("kdjf93487jdhf")
{
Name = "Ahmad",
Email = "ahmad@example.com"
};
Console.WriteLine(u1); // Prints object type
if (u1 == u2) // Compares references
Console.WriteLine("u1 & u2 are equal");
else
Console.WriteLine("u1 & u2 not equal");
Console.WriteLine();
// Record object
var p1 = new Post("23kdfh8374", "Post 1", "Post 1 content", u1.Id);
var p2 = new Post("23kdfh8374", "Post 1", "Post 1 content", u1.Id);
Console.WriteLine(p1); // Prints object type and data
if (p1 == p2) // Compare values
Console.WriteLine("p1 & p2 are equal");
else
Console.WriteLine("p1 & p2 not equal");