using System; using System.Runtime.Serialization; namespace ZeroLevel.Specification { [DataContract] public class ExpressionSpecification : BaseSpecification { [DataMember] private Func _expression; public ExpressionSpecification(Func expression) { if (expression == null!) throw new ArgumentNullException(); else this._expression = expression; } public override bool IsSatisfiedBy(T o) { return this._expression(o); } } }