This is my code in a controller; im using MVC 5 ASP.NET
var x = db.MyEntity.Include(ds => ds.MyEntity1)
.Where(ds =>
(
ds.MyEntity1.MyEntity12.x <= MyEntity1.MyEntity12.x
&&
ds.MyEntity1.MyEntity12.y>= MyEntity1.MyEntity12.x
)
||
(
ds.MyEntity1.MyEntity12.x<= MyEntity1.MyEntity12.y
&&
ds.MyEntity1.MyEntity12.y>= MyEntity1.MyEntity12.y
))
.Select(ds => ds.Emp);
var finalEmp = db.Emp.Except(x).ToList();
Now i want to reuse this x variable. I want to separate it into a method and call it from anywhere. But I'm having doubts what kind of a return value i should use in that method, so it will work with Except().
Thanks in advance.