-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.cs
32 lines (29 loc) · 875 Bytes
/
Person.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
using System;
using System.Collections.Generic;
using System.Text;
namespace Arrays
{
public record Person
{
public int Id { get; init; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public char Gender { get; set; }
public Person(int id, string firstName, string lastName, int age, char gender)
{
this.Id = id;
this.FirstName = firstName;
this.LastName = lastName;
this.Age = age;
this.Gender = gender;
}
public void Deconstruct(out string firstName, out string lastName, out int age, out char gender)
{
firstName = this.FirstName;
lastName = this.LastName;
age = this.Age;
gender = this.Gender;
}
}
}