sharee.bike-App/TINKLib/Model/Connector/Filter/IntersectGroupFilter.cs

20 lines
754 B
C#
Raw Normal View History

2021-05-13 20:03:07 +02:00
using System.Collections.Generic;
namespace TINK.Model.Connector.Filter
{
/// <summary> Filters to enumerations of string by intersecting.</summary>
public class IntersectGroupFilter : IGroupFilter
{
private IEnumerable<string> Group { get; set; }
public IntersectGroupFilter(IEnumerable<string> group) => Group = group ?? new List<string>();
/// <summary> Applies filtering. </summary>
/// <param name="filter">Enumeration of filter values to filter with or null if no filtering has to be applied.</param>
/// <returns></returns>
2021-11-07 21:28:13 +01:00
public IEnumerable<string> DoFilter(IEnumerable<string> filter) => filter != null
? Group.IntersectByGoupId(filter)
: Group;
2021-05-13 20:03:07 +02:00
}
}