Uki Uki - 2 months ago 8
C# Question

Why does the c#(web) linq syntax is different in vb(windows) linq syntax?

In c# web linq syntax for example

var sample = (from a in db.sample where a.id == id).singleordefault();


while in windows linq

dim sample = (from a in db.sample where a.id = id)


Because they have a different environment?.

Answer

The listed approach can be classified into LINQ method syntax and query syntax and both are semantically identical. Some of us find query syntax is simple and easy to read while others prefer method syntax because of it's expressiveness.

Following will help you to clarify;

Query and Method Syntax

Comments