Bug #84505 Using Contains method in expression with a variable throws exception in EF Core
| Submitted: | 13 Jan 2017 20:43 | Modified: | 9 Feb 2017 21:17 |
|---|---|---|---|
| Reporter: | Gabriela Martinez Sanchez | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / NET | Severity: | S3 (Non-critical) |
| Version: | 6.10 | OS: | Any |
| Assigned to: | Gabriela Martinez Sanchez | CPU Architecture: | Any |
[13 Jan 2017 20:43]
Gabriela Martinez Sanchez
Verified.
[9 Feb 2017 21:17]
Christine Cole
Posted by developer: Fixed as of the upcoming MySQL Connector/NET 6.10.1 release, and here's the changelog entry: EF Core: Using the Contains method in an expression with a variable generated an exception. Thank you for the bug report.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Using contains that uses a variable within a query throws the following exception: When called from 'VisitChildren', rewriting a node of type 'System.Linq.Expressions.Expression' must return a non-null value of the same type. Alternatively, override 'VisitChildren' and change it to not visit children of this type. EF Core 1.1 How to repeat: Create a simple context with at least an entity like the following example: using (var context = serviceProvider.GetRequiredService<ComputedColumnContext>()) { context.Database.EnsureCreated(); var e = new Employee { FirstName = "Jos", LastName = "Stuart" }; context.Employees.Add(e); context.SaveChanges(); var avalue = "jo"; var result = context.Employees.Where(t => t.FirstName.Contains(avalue)).ToList(); Assert.Equal(1, result.Count); context.Database.EnsureDeleted(); } Expected results: The Assert should be true. Suggested fix: Implement the missing visitchildren method.