mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
28 lines
737 B
C#
28 lines
737 B
C#
using System.Linq.Expressions;
|
|
|
|
namespace Lantean.QBTMud.Filter
|
|
{
|
|
public record PropertyFilterDefinition<T>
|
|
{
|
|
public PropertyFilterDefinition(string column, string @operator, object? value)
|
|
{
|
|
var (expression, propertyType) = ExpressionModifier.CreatePropertySelector<T>(column);
|
|
|
|
Column = column;
|
|
ColumnType = propertyType;
|
|
Operator = @operator;
|
|
Value = value;
|
|
Expression = expression;
|
|
}
|
|
|
|
public string Column { get; }
|
|
|
|
public Type ColumnType { get; }
|
|
|
|
public string Operator { get; set; }
|
|
|
|
public object? Value { get; set; }
|
|
|
|
public Expression<Func<T, object?>> Expression { get; }
|
|
}
|
|
} |