Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Hi Shalex,
it works now.
Thanks,
seb1487
it works now.
Thanks,
seb1487
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Hi Support,
I still have the problem with version 9.2.200 and EF Core when executing following Where clause on a nullable foreign key:
.Where(o => SelectedSupplierIds.Contains(o.SupplierId));
Error:
Unexpected primitive type kind 'a'
I still have the problem with version 9.2.200 and EF Core when executing following Where clause on a nullable foreign key:
.Where(o => SelectedSupplierIds.Contains(o.SupplierId));
Error:
Unexpected primitive type kind 'a'
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Thank you for your report. We have reproduced the issue. We will notify you when the problem is fixed.palmi wrote:Hi Support,
I still have the problem with version 9.2.200 and EF Core when executing following Where clause on a nullable foreign key:
.Where(o => SelectedSupplierIds.Contains(o.SupplierId));
Error:
Unexpected primitive type kind 'a'
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
The translation of collection's Contains method in LINQ query to SQL statement in EF Core is supported. We will notify you when the corresponding build of dotConnect for Oracle is available for download.palmi wrote:Hi Support,
I still have the problem with version 9.2.200 and EF Core when executing following Where clause on a nullable foreign key:
.Where(o => SelectedSupplierIds.Contains(o.SupplierId));
Error:
Unexpected primitive type kind 'a'
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
New build of dotConnect for Oracle 9.2.220 is available for download now: viewtopic.php?f=1&t=35058.
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Hi Support,
Thanks. Now I don't get an Exception but it does not really work.
When I have a List<long> it translates following LINQ query
to following SQL statement
I looks like it is always no matter how many entries my list has or what the value is.
Thanks. Now I don't get an Exception but it does not really work.
When I have a List<long> it translates following LINQ query
Code: Select all
.Where(o => SelectedSupplierIds.Contains(o.SupplierId));
Code: Select all
SELECT ... WHERE ... "order"."SupplierId" IN (2)
Code: Select all
IN (2)
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
1. Please set a break point, run your application in the debug mode, navigate to Debug > Windows > Modules, and make sure that the only Devart.* assemblies loaded in the process are:
Devart.Data.dll v5.0.1644.0
Devart.Data.Oracle.dll v9.2.220.0
Devart.Data.Oracle.Entity.EFCore.dll v9.2.220.0
2. We can reproduce the issue with ignoring some List values in this scenario:
The generated SQL in both cases is the same:
That is a designed behaviour (System.Data.SqlClient will work in the same way), the SQL query was cached by EF Core with the first query.ToList() and used with the second query.ToList().
Devart.Data.dll v5.0.1644.0
Devart.Data.Oracle.dll v9.2.220.0
Devart.Data.Oracle.Entity.EFCore.dll v9.2.220.0
2. We can reproduce the issue with ignoring some List values in this scenario:
Code: Select all
var Ids = new List<int>() { 1, 2};
var query = dbContext.Class1.Where(o => Ids.Contains(o.Id));
var results1 = query.ToList();
Ids.Add(3);
Ids.Add(4);
var results2 = query.ToList();
Code: Select all
SELECT "o"."Id", "o"."Class2Id", "o"."Name"
FROM "Class1" "o"
WHERE "o"."Id" IN (1, 2)
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
Hi Support,
I have this issue now again with EF Core 1.1 and Version 9.2.220.
When I have a List<long> it translates following LINQ query
to following SQL statement
And it is always
even though the List<long> (SelectedSupplierIds) only contains one item (e.g. 7)
I have this issue now again with EF Core 1.1 and Version 9.2.220.
When I have a List<long> it translates following LINQ query
Code: Select all
.Where(s => s.CatalogItems.Any(ci => searchParams.SelectedSupplierIds.Contains(ci.Catalog.SupplierId)));
Code: Select all
SELECT ... WHERE "ci.Catalog"."SupplierId" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Code: Select all
IN (1, 2, 3, ...)
Re: Entity Framework Core 1.0 throws System.NullReferenceException by SaveChanges
We cannot reproduce the issue in our environment. Could you please send us a small test project for reproducing?