From the course: Learning ASP.NET

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Querying data with LINQ

Querying data with LINQ

From the course: Learning ASP.NET

Start my 1-month free trial

Querying data with LINQ

- [Instructor] LINQ is an acronym for Language Integrated Query. It's a set of technologies that integrate query capabilities into the C# language. You're probably familiar with some of the different query languages like SQL for relational databases. But LINQ simplifies things by offering a consistent way to query and manipulate data across different data sources. You can write LINQ queries for SQL databases, XML documents, and .NET collections that implement the Ienumerable interface, basically, any format where a LINQ provider is available. LINQ to entities is what we use to write queries against the entity framework's conceptual model. Let's get back to our MVC application and explore how LINQ to entities works. Open the course controller. And let's add a private variable at the top for our Roux Academy database context. I'll name it db, and now we can use it in any of the controller actions. I'll add a new public action below index. It'll return an action result, and I'll call it…

Contents