You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Specification/CurrySpecification.cs

21 lines
484 B

using System;
namespace ZeroLevel.Specification
{
public class CurrySpecification<T, R> : BaseSpecification<T>
{
private readonly Func<T, R> _selector;
private readonly R _value;
public CurrySpecification(Func<T, R> selector, R val)
{
_selector = selector;
_value = val;
}
public override bool IsSatisfiedBy(T o)
{
return _selector(o)?.Equals(_value) ?? false;
}
}
}

Powered by TurnKey Linux.