Skip to content

EF primitive collection - nested string comparison operations #31030

@alienwareone

Description

@alienwareone
dbContext.Users.Where(x => !excludeEmails.Any(email => email.StartsWith("*")
  ? email.EndsWith("*") ? x.Email.Contains(email) : x.Email.StartsWith(email)
  : email.EndsWith("*") ? x.Email.EndsWith(email) : x.Email == email));

An exception of type 'System.InvalidOperationException' occurred in Microsoft.EntityFrameworkCore.Relational.dll but was not handled in user code: 'Store type 'nvarchar(max)' was inferred for a primitive collection, but that primitive collection was previously inferred to have store type 'nvarchar(max)'.'

Reproduction repository: https://github.com/alienwareone/EfCorePrimitiveCollection/tree/master

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions