if (items == null || items == Enumerable.Empty<TagOrIdItem>() || !items.Any())
{
return Enumerable.Empty<T>().AsQueryable();
}
Add a null check and validate items as being empty or no Any() in enumerable item Otherwise Null Exception from .Any().