LINQ Fundamentals

Big changes have been made to C# thanks to LINQ. This course will give you everything you need to work with the Language Integrated Query (LINQ) features of C#, using practical examples and demonstrating some best practices.
Course info
Rating
(474)
Level
Intermediate
Updated
Jul 28, 2016
Duration
4h 23m
Table of contents
Course Overview
An Introduction
LINQ and C#
LINQ Queries
Filter, Ordering & Projecting
Joining, Grouping & Aggregating
LINQ to XML
LINQ and the Entity Framework
Description
Course info
Rating
(474)
Level
Intermediate
Updated
Jul 28, 2016
Duration
4h 23m
Description

LINQ introduced radical changes to the C# language. In this course, LINQ Fundamentals you'll see features of the C# language that make LINQ work, as well as how to use LINQ effectively using practical examples. You'll start with seeing a demonstration of the power of LINQ along with some of the important features of the C# language for LINQ, including how to create and use extension methods and lambda expressions. Next, you'll focus on the behavior of LINQ queries and start to work with realistic data to learn how to filter, order, and project data. Finally, you'll see some demonstrations on how to use LINQ to XML as well as, how LINQ works with a remote datasource by using the Entity Framework against Microsoft SQL Server. By the end of this course, you'll be ready to process and query in-memory data, as well as work with XML and a SQL Server database.

About the author
About the author

Scott has over 15 years of experience in commercial software development and is a frequent speaker at national conferences, and local user groups. Scott is a Microsoft MVP and has authored books on several Microsoft technologies, including ASP.NET, C#, and Windows Workflow.

More from the author
C# Fundamentals
Beginner
6h 5m
Apr 16, 2019
ASP.NET Core Fundamentals
Beginner
5h 44m
Jan 23, 2019
More courses by Scott Allen
Section Introduction Transcripts
Section Introduction Transcripts

LINQ and C#
Hi. This is Scott, and this module is all about features of the C# language that you should know about to effectively use LINQ. These are features like extension methods and lambda expressions, and although LINQ relies on these features, you can use all of these features without using LINQ, and without writing a query. In other words, understanding features of C#, like extension methods and lambda expressions, it is important for any kind of C# development these days, not just programming with LINQ. To understand these features let's first talk about what LINQ is trying to accomplish. Then we can understand how these features help the language achieve the goals of LINQ.

LINQ Queries
Hi. This is Scott, and my goal in this module is to explain how LINQ queries behave. It's vitally important to understand how LINQ queries behave if you want to write code that is safe and performs well. In this module we'll see how some query operators offer a feature known as deferred execution. That's a fancy term for a behavior that you can sometimes use to your advantage, but if you're not careful deferred execution can also be to your detriment, so we'll come to understand how deferred execution works, and we'll start this by implementing another LINQ operator on our own, this time a filtering operator.

Filter, Ordering & Projecting
Hi. This is Scott, and in this module we will learn how to filter, sort, and project data using LINQ against a data source that might resemble something you would work with in the real world, a larger dataset than we have been working with, and a dataset where we would like to analyze some numbers, and answer some interesting questions. Let's jump right in, and introduce the data source, and see how we can use LINQ to process and analyze the fuel efficiency of cars.

Joining, Grouping & Aggregating
Hi. This is Scott, and in this module we will continue to learn about new LINQ operators as we perform some sophisticated data analysis on fuel efficiency. We will learn how to join two datasets together, how to group data, and how to aggregate data to produce summary statistics.

LINQ to XML
Hi. This is Scott, and in this module I'll show you how to use LINQ to XML. We will query XML and create XML using a new XML API that was designed to work with LINQ and new features of the C# language. We're going to take this close look at LINQ to XML because many of us work with XML on a day to day basis in our applications. Perhaps we use XML to exchange data with business partners or save data within our company. XML is still a popular data exchange format with many different standards and schemas to choose from. In this module I want to show you how easy it is to work with this new API. It's certainly easier than the original XML APIs and. NET. We'll look at this API by continuing to work with our car data, and first transform out csv file into XML.

LINQ and the Entity Framework
Hi. This is Scott, and in this module we're going to learn about how LINQ works with a remote LINQ provider. That is a provider that uses our LINQ statement to execute our queries in a different process, maybe even on a different machine, and using a command language that the data source understands. To see how this works we will be using Microsoft's Entity Framework to talk to our relational database. This module is not an Entity Framework tutorial. There are other courses on Pluralsight that will give you the Entity Framework fundamentals. Instead, we will focus on how the Entity Framework is able to translate our LINQ statements into SQL commands or a SQL server database.