-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyBook.cs
More file actions
30 lines (27 loc) · 722 Bytes
/
MyBook.cs
File metadata and controls
30 lines (27 loc) · 722 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
namespace CSharp.Deconstruction.Demo
{
// declare a class with Deconstruct method(s)
class MyBook
{
public int Id { get; set; }
public string Title { get; set; }
public string Author { get; set; }
public MyBook(int id, string title, string author)
{
Id = id;
Title = title;
Author = author;
}
public void Deconstruct(out int id, out string title, out string author)
{
id = Id;
title = Title;
author = Author;
}
public void Deconstruct(out string title, out string author)
{
title = Title;
author = Author;
}
}
}