|
@@ -245,8 +245,8 @@ public class FilterNode<T> : BaseFilterNode
|
|
|
|
|
|
private ValueNode? CreateValueNode(string propertyName, Operator op)
|
|
private ValueNode? CreateValueNode(string propertyName, Operator op)
|
|
{
|
|
{
|
|
- var property = CoreUtils.GetProperty(typeof(T), propertyName);
|
|
|
|
- return CreateValueNode(property.PropertyType, op);
|
|
|
|
|
|
+ var property = DatabaseSchema.Property(typeof(T), propertyName);
|
|
|
|
+ return property is not null ? CreateValueNode(property.PropertyType, op) : null;
|
|
}
|
|
}
|
|
|
|
|
|
[MemberNotNull(nameof(Value))]
|
|
[MemberNotNull(nameof(Value))]
|
|
@@ -262,11 +262,10 @@ public class FilterNode<T> : BaseFilterNode
|
|
private ConstantNode? CreateConstantNode(string? propertyName, Operator op, FilterConstant? constantvalue)
|
|
private ConstantNode? CreateConstantNode(string? propertyName, Operator op, FilterConstant? constantvalue)
|
|
{
|
|
{
|
|
var values = new List<KeyValuePair<string, FilterConstant?>>();
|
|
var values = new List<KeyValuePair<string, FilterConstant?>>();
|
|
- if (!string.IsNullOrWhiteSpace(propertyName))
|
|
|
|
|
|
+ if (!string.IsNullOrWhiteSpace(propertyName) && DatabaseSchema.Property(typeof(T), propertyName) is IProperty property)
|
|
{
|
|
{
|
|
- var property = CoreUtils.GetProperty(typeof(T), propertyName);
|
|
|
|
- var constants = FilterConstants.Constants(property.PropertyType, op, property.GetCustomAttribute<AggregateAttribute>() != null);
|
|
|
|
- if (constants.Any())
|
|
|
|
|
|
+ var constants = FilterConstants.Constants(property.PropertyType, op, property.HasAttribute<AggregateAttribute>());
|
|
|
|
+ if (constants.Length != 0)
|
|
{
|
|
{
|
|
values.Add(new KeyValuePair<string, FilterConstant?>("", null));
|
|
values.Add(new KeyValuePair<string, FilterConstant?>("", null));
|
|
foreach (var constant in constants)
|
|
foreach (var constant in constants)
|