-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Results should be read-only (breaking change).
- Loading branch information
1 parent
c88451f
commit 550ba56
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
using System.Collections.Generic; | ||
using System; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
|
||
namespace GeoTimeZone | ||
{ | ||
public class TimeZoneResult | ||
{ | ||
public TimeZoneResult() | ||
internal TimeZoneResult(params string[] timeZones) | ||
{ | ||
AlternativeResults = new List<string>(); | ||
if (timeZones.Length == 0) | ||
{ | ||
throw new ArgumentException("There must be at least one value provided.", nameof(timeZones)); | ||
} | ||
|
||
this.Result = timeZones[0]; | ||
this.AlternativeResults = new ReadOnlyCollection<string>(timeZones.Skip(1).ToList()); | ||
} | ||
|
||
public string Result { get; set; } | ||
public List<string> AlternativeResults { get; set; } | ||
public string Result { get; } | ||
public ReadOnlyCollection<string> AlternativeResults { get; } | ||
} | ||
} |