1

I have issue when filter data using filter editor, I'm using object(order) to get data I get this error :

System.NotSupportedException: 'Cannot compare elements of type 'System.Collections.Generic.ICollection`1[[CodeEffects.Rule.Asp.Demo.Entities.Order, CodeEffects.Rule.Asp.Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. Only primitive types, enumeration types and entity types are supported.'

enter image description here

Rio
  • 11
  • 1

1 Answers1

0

The Entity Framework no longer, if it ever did, supports comparison of related tables with null. The CodeEffects probably needs to adjust their code to account for it.

As a workaround, set EvaluationParameters.PerformNullChecks = false as in:

EvaluationParameters evps = new EvaluationParameters 
{
    LINQProviderType = LinqProviderType.Entities, 
    PerformNullChecks = false 
};

You pass those parameters in the Evaluator's constructor.

Note, this will disable all null-checks, which may or may not be a problem in your particular case.

Ruslan
  • 1,761
  • 9
  • 16