Skip to content

Commit

Permalink
Results should be read-only (breaking change).
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Jun 18, 2019
1 parent c88451f commit 550ba56
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/GeoTimeZone/TimeZoneResult.cs
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; }
}
}

0 comments on commit 550ba56

Please sign in to comment.