-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyClass.cs
More file actions
34 lines (32 loc) · 1008 Bytes
/
Copy pathMyClass.cs
File metadata and controls
34 lines (32 loc) · 1008 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
namespace ProjectDSA
{
internal class MyClass
{
// Base class for A, B, C
public class Class_Lst
{
public string Name { get; set; }
public string Gender { get; set; }
public int Age { get; set; }
// Build sentence for the selected property
public string View(string option)
{
switch (option)
{
case "Name":
return $"Hello, my Name is: {Name}.";
case "Gender":
return $"Hello, my Gender is: {Gender}.";
case "Age":
return $"Hello, my Age is: {Age}.";
default:
return string.Empty;
}
}
}
// 3 classes: A, B, C
public class ClassA : Class_Lst { }
public class ClassB : Class_Lst { }
public class ClassC : Class_Lst { }
}
}