C# LINQ — Query Syntax vs. Method Syntax

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

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:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vincent Taylor

Vincent Taylor

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