Skip to content

Commit

Permalink
Add 'init' accessor to Age class's public properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
arman-g committed Sep 23, 2021
1 parent c1d4c90 commit cb44edb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AgeCalculator/AgeCalculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryUrl>https://github.com/arman-g/AgeCalculator</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>age calculator</PackageTags>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
<PackageReleaseNotes>For sample usage see the REDME file under the repository.</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/arman-g/AgeCalculator</PackageProjectUrl>
<ApplicationIcon />
Expand Down
8 changes: 4 additions & 4 deletions AgeCalculator/Models/Age.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ public class Age
/// <summary>
/// Gets the years component of the <see cref="Age"/> class.
/// </summary>
public int Years { get; }
public int Years { get; init; }

/// <summary>
/// Gets the months component of the <see cref="Age"/> class.
/// </summary>
public byte Months { get; }
public byte Months { get; init; }

/// <summary>
/// Gets the days component of the <see cref="Age"/> class.
/// </summary>
public byte Days { get; }
public byte Days { get; init; }

/// <summary>
/// Gets the time component of the <see cref="Age"/> class.
/// </summary>
public TimeSpan Time { get; }
public TimeSpan Time { get; init; }

#endregion

Expand Down

0 comments on commit cb44edb

Please sign in to comment.