Linq To Objects

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Linq To Objects as PDF for free.

More details

  • Words: 199
  • Pages: 18
LINQ to Objects

LINQ to Objects • LINQ to Objects allows .NET developers to write “queries” over collections of objects. • Traditionally, working with collections of objects meant writing a lot of looping code using for loops or foreach loops to iterate through a list carrying out filtering using if statements, and some action like keeping a running sum of a total property. • LINQ frees you from having to write looping code; it allows you to write queries that filter a list or calculate aggregate functions on elements in a collection as a set.

An example of calculating the aggregate sum of all the elements would look like

If you are used to Select-From-WhereOrderBy, it might take some time to overcome the muscle memory and move to From-Where-OrderBy-Select.

The end-II

“s in” portion of the query that provides a reference to the set of elements contained in the source,

datasource

Endwith method is of string

Is C# still performing static type checking? The answer is yes, it still statically checks types at compile time. What feature or features of C# are allowing all of this? The answer is Microsoft’s Language Integrated Query, otherwise known as LINQ.

The end

Related Documents

Linq To Objects
November 2019 6
Linq
October 2019 16
Linq
August 2019 26
Linq To Sql
April 2020 4
Linq To Xml
November 2019 11
Linq To Xml Overview
May 2020 12