Archives
-
Entity Framework/Core and LINQ to Entities (9) Performance
The previous parts has discussed some aspects that can impact the performance of EF/Core and LINQ to Entities, and here is a summary:
-
Entity Framework/Core and LINQ to Entities (8) Optimistic Concurrency
Conflicts can occur if the same data is read and changed concurrently. Generally, there are 2 concurrency control approaches:
-
Entity Framework/Core and LINQ to Entities (7) Data Changes and Transactions
Besides LINQ to Entities queries, EF/Core also provides rich APIs for data changes, with imperative paradigm.
-
Entity Framework/Core and LINQ to Entities (6) Query Data Loading
After translated to SQL, in LINQ to Entities, sequence queries returning IQueryable<T> implements deferred execution too.
-
Entity Framework/Core and LINQ to Entities (5) Query Translation Implementation
The previous part demonstrated what are the SQL translations of the LINQ to Entities queries. This part discusses how the translation is implemented. Regarding different database systems can have different query languages or different query APIs, EF/Core implement a provider model to work with different kinds of databases. In EF Core, the base libraries are the Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Relational NuGet packages. Microsoft.EntityFrameworkCore provides the database provider contracts as Microsoft.EntityFrameworkCore.Storage.IDatabaseProviderServices interface. And the SQL database support is implemented by the Microsoft.EntityFrameworkCore,SqlServer NuGet package, which provides Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseProviderServices type to implement IDatabaseProviderServices. There are other libraries for different databases, like Microsoft.EntityFrameworkCore.SQLite NuGet package for SQLite, etc.
-
Entity Framework/Core and LINQ to Entities (4) Query Methods (Operators)
This part discusses how to query SQL database with the defined mapping entities. In EF/Core, LINQ to Entities supports most of the methods provided by Queryable:
-
Entity Framework/Core and LINQ to Entities (3) Logging and Tracing Queries
EF version of this i
-
Entity Framework/Core and LINQ to Entities (2) Modeling Database: Object-Relational Mapping
.NET and SQL database and have 2 different data type systems. For example, .NET has System.Int64 and System.String, while SQL database has bigint and nvarchar; .NET has sequences and objects, while SQL database has tables and rows;, etc. Object-relational mapping is a popular technology to map and convert between application data objects and database relational data. In LINQ to Entities, the queries are based on Object-relational mapping.
-
Entity Framework/Core and LINQ to Entities (1) Remote Query
The previous chapters discussed LINQ to Objects, LINQ to XML (objects), and Parallel LINQ (to Objects). All of these LINQ technologies query local in-memory objects managed by .NET. This chapter discusses a different kind of LINQ technology, LINQ to Entities, which queries relational data managed by databases. LINQ to Entities was provided by Entity Framework (EF), a Microsoft library released since .NET Framework 3.5 Service Pack 1. In 2016, Microsoft also released the cross platform version, Entity Framework Core (EF Core), along with with .NET Core 1.0. EF and EF Core both implement a provider model, so that LINQ to Entitiescan be implemented by different providers to work with different kinds of databases, including SQL Server (on-premise database) and Azure SQL Database (cloud database, aka SQL Azure), DB2, MySQL, Oracle, PostgreSQL, SQLLite, etc.