// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
using System.Linq.Expressions;
namespace Geekeey.Request.Persistence;
///
/// Stores information about a where expression.
///
/// The entity type.
public sealed class WhereExpressionInfo
{
private readonly Lazy> _filterFunc;
///
/// Creates a new where expression info.
///
/// The filter expression.
public WhereExpressionInfo(Expression> filter)
{
ArgumentNullException.ThrowIfNull(filter);
Filter = filter;
_filterFunc = new Lazy>(Filter.Compile);
}
///
/// Gets the filter expression.
///
public Expression> Filter { get; }
///
/// Gets the compiled filter function.
///
public Func FilterFunc => _filterFunc.Value;
}