-
Notifications
You must be signed in to change notification settings - Fork 18
/
Program.cs
37 lines (29 loc) · 837 Bytes
/
Program.cs
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
37
using Records;
var unlabelled = new OptionallyLabelledItem();
var labelled = new OptionallyLabelledItem
{
Label = "New, improved!"
};
var unlabelledProduct = new Product("Book");
var labelledProduct = new Product("Shirt")
{
Label = "Half price"
};
Console.WriteLine(unlabelled);
Console.WriteLine(labelled);
Console.WriteLine(unlabelledProduct);
Console.WriteLine(labelledProduct);
var commonModelT = new FordModelT();
var lateModelT = new FordModelT { Color = "Green" };
Console.WriteLine(commonModelT);
Console.WriteLine(lateModelT);
OptionallyLabelled Discount(OptionallyLabelled item)
{
return item with
{
Label = "60% off!"
};
}
Console.WriteLine(Discount(new OptionallyLabelledItem()));
Console.WriteLine(Discount(new Product("Sweater")));
Console.WriteLine(new LabelledDemographic("Noisy"));