Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/Examine.Core/ValueSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public ValueSet(string id, string category, IDictionary<string, object> values)
/// <param name="itemType"></param>
/// <param name="values"></param>
public ValueSet(string id, string category, string itemType, IDictionary<string, object> values)
: this(id, category, itemType, values.ToDictionary(x => x.Key, x => Yield(x.Value)))
: this(id, category, itemType,
(IReadOnlyDictionary<string, IReadOnlyList<object>>)values.ToDictionary(
x => x.Key,
x => (IReadOnlyList<object>)new[] { x.Value }))
{
}

Expand Down Expand Up @@ -129,16 +132,6 @@ public object GetValue(string key)
return !Values.TryGetValue(key, out var values) ? null : values.Count > 0 ? values[0] : null;
}

/// <summary>
/// Helper method to return IEnumerable from a single
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
private static IEnumerable<object> Yield(object i)
{
yield return i;
}

public ValueSet Clone() => new ValueSet(Id, Category, ItemType, Values);
}
}