T
Tony Johansson
Hello!
I have two linq queries below and I wonder are these the same and will give
the same result ?
My second question. As I have understood the first one is using Lambda
expression and in the
second is just a strict Linq query. Is this correct understood ?
Is it any difference in performance between these two ?
A question about understanding for the first one.
Here you return true for those that match the string literal "Rio de
Janeiro"
but then what data is this *.Select(c => c);* operate on ?
Is this *.Select(c => c);* operate on those data that is return as true
from
Where(c => c.City == "Rio de Janeiro"
var custs = db.Customers
..Where(c => c.City == "Rio de Janeiro"
..Select(c => c);
var custs =
from c in db.Customers
where c.City == "Rio de Janeiro"
select c;
//Tony
I have two linq queries below and I wonder are these the same and will give
the same result ?
My second question. As I have understood the first one is using Lambda
expression and in the
second is just a strict Linq query. Is this correct understood ?
Is it any difference in performance between these two ?
A question about understanding for the first one.
Here you return true for those that match the string literal "Rio de
Janeiro"
but then what data is this *.Select(c => c);* operate on ?
Is this *.Select(c => c);* operate on those data that is return as true
from
Where(c => c.City == "Rio de Janeiro"
var custs = db.Customers
..Where(c => c.City == "Rio de Janeiro"
..Select(c => c);
var custs =
from c in db.Customers
where c.City == "Rio de Janeiro"
select c;
//Tony