entity framework Archives - {coding}Sight https://codingsight.com/tag/entity-framework/ Blog for SQL Server DBAs and Developers Mon, 18 Oct 2021 14:49:08 +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 entity framework Archives - {coding}Sight https://codingsight.com/tag/entity-framework/ 32 32 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.

]]>
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
Implementing OOP Inheritance in Classes that work with SQL and Entity Framework https://codingsight.com/implementing-oop-inheritance-in-classes-that-work-with-sql-and-ms-entity-framework/ Wed, 16 Aug 2017 10:49:21 +0000 http://codingsight.com/?p=2033 This article is about creating a data model that would nicely fit SQL and contain “proper” OOP inheritance. I must say that I encountered this problem at various times on different projects, and I solved it in different ways. The names of the approaches are taken from the terminology that has developed on the relevant …

The post Implementing OOP Inheritance in Classes that work with SQL and Entity Framework appeared first on {coding}Sight.

]]>
Sliding Responsibility of the Repository Pattern https://codingsight.com/sliding-responsibility-of-the-repository-pattern/ https://codingsight.com/sliding-responsibility-of-the-repository-pattern/#comments Thu, 03 Aug 2017 13:13:40 +0000 http://codingsight.com/?p=1987 During numerous discussions about the applicability of the Repository pattern, I noticed that people are divided into two groups. In this article, I will call them abstractionists and concretists. The difference between them is in the way they treat the pattern value. The former believe that a repository is worthwhile, as it allows disregarding details …

The post Sliding Responsibility of the Repository Pattern appeared first on {coding}Sight.

]]>
https://codingsight.com/sliding-responsibility-of-the-repository-pattern/feed/ 4
OdataToEntity – an easy way to create .Net Core OData services https://codingsight.com/odatatoentity-an-easy-way-to-create-net-core-odata-services/ Fri, 14 Jul 2017 08:30:11 +0000 http://codingsight.com/?p=1798 When .Net Core was released, the old version of OData ASP.NET Web API turned out to be incompatible with the new platform. This fatal flaw allowed me to create my OData implementation on the .Net Core platform. After the creative rethinking of the previous implementation, I came to an understanding that it suffered from a …

The post OdataToEntity – an easy way to create .Net Core OData services appeared first on {coding}Sight.

]]>
Entity Framework: Improving Performance when Saving Data to Database https://codingsight.com/entity-framework-improving-performance-when-saving-data-to-database/ https://codingsight.com/entity-framework-improving-performance-when-saving-data-to-database/#comments Tue, 30 May 2017 11:26:46 +0000 http://codingsight.com/?p=1534 When adding or modifying a large number of records (10³ and more), the Entity Framework performance is far from perfect. The reasons are architectural peculiarities of the framework, and non-optimality of the generated SQL. Leaping ahead, I can reveal that saving data through a bypass of the context significantly minimizes the execution time. Contents Insert/Update …

The post Entity Framework: Improving Performance when Saving Data to Database appeared first on {coding}Sight.

]]>
https://codingsight.com/entity-framework-improving-performance-when-saving-data-to-database/feed/ 4
Entity Framework 6: Extensions You Might Be Unaware Of https://codingsight.com/entity-framework-6-extensions-you-might-be-unaware-of/ https://codingsight.com/entity-framework-6-extensions-you-might-be-unaware-of/#comments Fri, 14 Apr 2017 07:05:03 +0000 http://codingsight.com/?p=1195 Entity Framework 6 was and still remains a ‘workhorse’ for data access incorporate. NET-based applications primarily because of their stability, low barrier of entry, and wide renown. Therefore, I hope this article will still be useful. Contents Database First without EDMX Working with detached graphs SQL modification Data caching beyond the boundaries of the DbContext …

The post Entity Framework 6: Extensions You Might Be Unaware Of appeared first on {coding}Sight.

]]>
https://codingsight.com/entity-framework-6-extensions-you-might-be-unaware-of/feed/ 2