Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: UpForGrabs :: Query: Translation of Contains/DefaultIfEmpty LINQ operators cause unnecessary cache misses and pollution [1446]

$
0
0
This was discovered while verifying: https://entityframework.codeplex.com/workitem/197 and is essentially the same problem.
Basically when using contains like so:

```
int foo = 10;

ctx.Customers.Select(c => c.Id).Contains(foo);

foo = 20;
ctx.Customers.Select(c => c.Id).Contains(foo);
```

and DefaultIfEmpty like so:

```
var bar = "Dog";
ctx.Customers.Select(c => c.Name).DefaultIfEmpty(bar).ToList();
bar = "Cat";
ctx.Customers.Select(c => c.Name).DefaultIfEmpty(bar).ToList();
```

the values of foo and bar do not get parametrized. We fixed that for Take and Skip in EF6 (these two are much more prevalent), but we should also fix Contains and DIE in a future.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>