Last post Feb 04, 2016 03:09 PM by Mikesdotnetting
Feb 04, 2016 02:28 PM|Adam-M|LINK
I wanted to confirm something. In MVC when running a query such as:
var test = (from x from db.table1
where x.id == 1
var test2 = (from y from db.table1
where y.id == 2
var test3 = (from z from db.table2
where z.id == 3
If I was to perform the above is it possible to use the same letter as an alias (x for example) as opposed to changing with each query (x, y, z).
Thanks in advance
Feb 04, 2016 03:09 PM|Mikesdotnetting|LINK
You can re-use the same variable name. It is a range variable and is only applicable within the scope of the individual query.