EntityFrameworkCore.FirebirdSQL icon indicating copy to clipboard operation
EntityFrameworkCore.FirebirdSQL copied to clipboard

Invalid query constructed when check for list.Contains(element) and the list is empty

Open slavanap opened this issue 6 years ago • 0 comments

The issue

Tested sample:

List<int> parts = new List<int>();
var groupsQ = from grp in _context.Groups
              join item in _context.Items on grp.Id equals item.GroupId
              where item.PartId.HasValue && parts.Contains(item.PartId.Value)
              select grp;

Steps to reproduce

Check for List<T>.Contains(X) when the list is empty.

Error details

capture

Further technical details

Firebird version: 2.5.8 EntityFrameworkCore.FirebirdSql version: 6.1.0

slavanap avatar Aug 18 '18 00:08 slavanap