From cb44edbf5d7e98cb07a7f111cc8f8891f97011af Mon Sep 17 00:00:00 2001 From: Arman Ghazanchyan Date: Thu, 23 Sep 2021 14:08:02 -0700 Subject: [PATCH] Add 'init' accessor to Age class's public properties. --- AgeCalculator/AgeCalculator.csproj | 2 +- AgeCalculator/Models/Age.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AgeCalculator/AgeCalculator.csproj b/AgeCalculator/AgeCalculator.csproj index d730e66..367832b 100644 --- a/AgeCalculator/AgeCalculator.csproj +++ b/AgeCalculator/AgeCalculator.csproj @@ -9,7 +9,7 @@ https://github.com/arman-g/AgeCalculator Git age calculator - 1.1.1 + 1.1.2 For sample usage see the REDME file under the repository. https://github.com/arman-g/AgeCalculator diff --git a/AgeCalculator/Models/Age.cs b/AgeCalculator/Models/Age.cs index 705d611..d080898 100644 --- a/AgeCalculator/Models/Age.cs +++ b/AgeCalculator/Models/Age.cs @@ -29,22 +29,22 @@ public class Age /// /// Gets the years component of the class. /// - public int Years { get; } + public int Years { get; init; } /// /// Gets the months component of the class. /// - public byte Months { get; } + public byte Months { get; init; } /// /// Gets the days component of the class. /// - public byte Days { get; } + public byte Days { get; init; } /// /// Gets the time component of the class. /// - public TimeSpan Time { get; } + public TimeSpan Time { get; init; } #endregion