mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-07-01 02:46:37 +02:00
20 lines
754 B
C#
20 lines
754 B
C#
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>
|
|
public IEnumerable<string> DoFilter(IEnumerable<string> filter) => filter != null
|
|
? Group.IntersectByGoupId(filter)
|
|
: Group;
|
|
}
|
|
}
|