C# LINQ — Query Syntax vs. Method Syntax

LINQ (Language-Integrated Query) is a set of integrated C# capabilities which allow queries against data.

Vincent Taylor
Dec 14, 2021

Today’s Objective: Go over the simple differences between the Query Syntax and the Method Syntax for writing query code.

What are they? What are the differences?

Query syntax and method syntax are semantically identical, but many people find query syntax simpler and easier to read. — Microsoft Documentation

There are no technical differences between the two. They are both simply ways to write query code.

Another Example:

Either syntax is a valid way to write query code, and each has their uses. It is basically up to the programmer to decide which suits their needs or preferences best.

A Step-By-Step Explanation:

--

--

Vincent Taylor

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.