linq Archives - {coding}Sight https://codingsight.com/tag/linq/ Blog for SQL Server DBAs and Developers Mon, 13 Mar 2023 12:55:14 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png linq Archives - {coding}Sight https://codingsight.com/tag/linq/ 32 32 Syntax of LINQ GroupBy Method in C# https://codingsight.com/the-linq-groupby-method/ Sun, 02 Oct 2022 17:13:00 +0000 http://codingsight.com/?p=16837 We are continuing our series dedicated to LINQ technologies with a more detailed look at some methods available under the LINQ umbrella. The focus of the current article is the GroupBy method. By definition, the GroupBy method groups the elements of a sequence by the specified key selector function and returns the result value from …

The post Syntax of LINQ GroupBy Method in C# appeared first on {coding}Sight.

]]>
Different types of LINQ queries: Query Syntax and Method Syntax https://codingsight.com/different-flavors-of-linq-query-operations/ Sun, 02 Oct 2022 07:56:00 +0000 http://codingsight.com/?p=14513 The current article continues the series about LINQ. The previous part introduced the LINQ technologies and demonstrated its usage on some basic examples and a couple of more advanced coding challenges. The current article will further expose different ways to write LINQ query operations. LINQ queries can be written in two syntax types, a Query …

The post Different types of LINQ queries: Query Syntax and Method Syntax appeared first on {coding}Sight.

]]>
LINQ to Entities – Tutorial with Examples https://codingsight.com/introducing-linq-to-entities/ Wed, 03 Aug 2022 07:54:00 +0000 http://codingsight.com/?p=14805 When we think about querying databases, the first thing that pops to mind is usually some SQL query. Then other questions arise in regards to the database type, connection, query design, etc. LINQ to Entities combined with Entity Framework allows the developers to skip a big portion of these questions and worries. Entity Framework handles …

The post LINQ to Entities – Tutorial with Examples appeared first on {coding}Sight.

]]>
LINQ to XML: Easy Work in C# https://codingsight.com/xml-made-easy-linq-to-xml/ Fri, 23 Jul 2021 08:35:18 +0000 http://codingsight.com/?p=15718 LINQ to XML is an in-memory XML programming interface that enables XML manipulation. Similar to the more traditional Document Object Model (DOM), LINQ to XML brings XML documents into memory and lets you query and modify them before saving the results to a file or data stream. What is different from the DOM is the …

The post LINQ to XML: Easy Work in C# appeared first on {coding}Sight.

]]>
Entity Framework – Just a Few Clicks Away https://codingsight.com/entity-framework-tutorial-how-to-add-ef-to-your-net-project/ Wed, 09 Jun 2021 07:01:49 +0000 http://codingsight.com/?p=14529 Entity Framework is an open-source object-relational mapping (ORM) framework for .NET applications. It let the developers work with data on a higher level of abstraction without the need to worry about the database type or structure where the data is stored. The focus of this article will be to show and explain how easy it …

The post Entity Framework – Just a Few Clicks Away appeared first on {coding}Sight.

]]>
LINQ in C#: A tutorial with Query Examples in LINQ to Objects https://codingsight.com/what-is-linq-in-c-sharp/ Thu, 22 Apr 2021 12:55:53 +0000 http://codingsight.com/?p=12808 Less is more – this is definitely true when it comes to object collections and LINQ queries. One of the most valuable advantages is the ability to write cleaner and more concise code, thus accomplishing more with fewer lines. The current article will introduce the basic understanding of LINQ technologies and present alternatives to the …

The post LINQ in C#: A tutorial with Query Examples in LINQ to Objects appeared first on {coding}Sight.

]]>
Functional F# that slowly appears in C# https://codingsight.com/functional-f-that-slowly-appears-in-c/ https://codingsight.com/functional-f-that-slowly-appears-in-c/#comments Mon, 18 Dec 2017 10:28:26 +0000 http://codingsight.com/?p=2922 For some reason, we often do not use this functionality. Maybe we haven’t got used to it yet. And sometimes we use it, having no idea that this is the functionality from F#. Before reviewing it, let’s quickly run through the most interesting features that appeared in different versions of the language. Note that each time …

The post Functional F# that slowly appears in C# appeared first on {coding}Sight.

]]>
https://codingsight.com/functional-f-that-slowly-appears-in-c/feed/ 1
Using Expressions to Filter Data of Database https://codingsight.com/using-expressions-to-filter-data-of-database/ Fri, 10 Nov 2017 12:36:04 +0000 http://codingsight.com/?p=2489 I would like to start with a description of the problem that I encountered. There are entities in the database that need to be displayed as tables on the UI. The Entity Framework is used to access the database. There are filters for these table columns. It is necessary to write a code to filter entities by parameters. …

The post Using Expressions to Filter Data of Database appeared first on {coding}Sight.

]]>
Generic Repository Pattern in Entity Framework https://codingsight.com/entity-framework-antipattern-repository/ https://codingsight.com/entity-framework-antipattern-repository/#comments Thu, 07 Sep 2017 05:52:59 +0000 http://codingsight.com/?p=2164 A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection. Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Entity Framework provides us with the actual implementation of the Repository patterns: DbSet<T> and UnitOfWork: DbContext. I often see colleagues using in projects their own …

The post Generic Repository Pattern in Entity Framework appeared first on {coding}Sight.

]]>
https://codingsight.com/entity-framework-antipattern-repository/feed/ 2
LINQ: Dynamic Creation of Query Filters https://codingsight.com/linq-dynamic-creation-of-query-filters/ Fri, 01 Sep 2017 12:46:11 +0000 http://codingsight.com/?p=2145 Sooner or later, each developer has to create data tables with the possibility to sort by columns. I am not an exception. In our project, there are similar tables almost on every page. So, 90 % of the content is output on them. Of course, search and sorting by tables work without reloading a page. …

The post LINQ: Dynamic Creation of Query Filters appeared first on {coding}Sight.

]]>