What is LINQ and what is not LINQ? -
i've seen examples of following referred linq.
var y = _context.persons; iqueryable<person> x = _context.persons; var z = tblperson in _context.persons select tblperson;
are linq, different flavours of or z linq? if other 2 called? if they're linq how differentiate between 3 when googling information them? y , x should using var or iqueryable in mvc core (and why) , should using either on z?
thanks jereon links. wasn't sure if var or iqueryable intrinsically linked implementation of linq or whether more generic question. generic is.
from links above variety of linq
from tblperson in _context.persons select tblperson;
is referred either
- query syntax
- query expression
- query comprehension syntax
while variety of linq
db.person = _context.persons .include(px => px.gender) .include(px => px.title) .include(px => px.addressids) .theninclude(px => px.addresstype) .where(px => px.name.contains("foo") .orderby(px => px.name);
is referred either
- extension method
- method syntax
- fluent syntax
as usage, general opinion seemed in 2 camps
- use 1 or other throughout project
mix-and-match use query syntax following
- when using let keyword
- when have multiple generators (from clauses)
- when doing joins
and extension method else.
Comments
Post a Comment