For testing i simple putĀ e != null and e.Permissoes != null, is comparing with root anytime with List<Type>for example:
var x = _context.GetDbSet<Operador>().Where(e => e != null && e.Permissoes != null e.Permissoes.Any(s=> s.Semantica == PermissaoSemantica.Despacho)).Select(e => e.Sigla).ToArray();
Where Permissoes is a list of some object, is gererating the following query, and for this properties with null value by anycase is not bein removed from the search and crashing on e.Permissoes.Any causing: 'Command getMore failed: Executor error during getMore :: caused by :: $anyElementTrue's argument must be an array, but is null'
{ "$match" : { "$and" : [{ "$expr" :
{ "$ne" : ["$$ROOT", null] }}, { "$expr" :
{ "$ne" : ["$$ROOT", null] }}, { "$expr" : { "$anyElementTrue" : { "$map" : { "input" : "$Permissoes", "as" : "o0", "in" :
{ "$eq" : ["$$o0.Semantica", 0] }} } } }] } }, { "$project" :
{ "_v" : "$Sigla", "_id" : 0 }}
1.
|
Possible Solution for now | EF-200 |
|
Closed | Damien Guard |