how to reproduce issue:
create table ytrewqs
id|Name
1 |One
2 |Two
3 |Three
using version 4.65 and it's standard c# templates create model from database with this table
write, compile and run this
Code: Select all
var context = new TestDataContext();
var notin = new List {1};
var entities = context.ytrewqs.Where(o=> !notin.Contains(o.id));
Console.WriteLine(entities.Count());//result 2
notin.Add(2);
Console.WriteLine(entities.Count());//result 1
check referencies and without code regeneration run code. result is as expected;
then recreate model from database and again run this code. entities.Count() in both lines returns 2.
if rewrite code like this
Code: Select all
var context = new TestDataContext();
var notin = new List {1};
var entities = context.ytrewqs.Where(o=> !notin.Contains(o.id));
Console.WriteLine(entities.Count());//result 2
var notin = new List {1,2};
var entities = context.ytrewqs.Where(o=> !notin.Contains(o.id));
Console.WriteLine(entities.Count());//result 1
BTW. The templates from 4.65 incompatible to 4.90