In this post I will show how you can call stored procedures with OUTPUT parameters from EF Core. I am using the Northwind database for the sample code.
When working with a fast-evolving project changes happen rapidly not only to the project’s code but also to the database schema. It happens especially when working on a micro-service from the start when its purpose shifts.
Today, the Entity Framework Core team announces the seventh preview release of EF Core 5.0. This release includes a factory to create DbContext instances, the ability to reset DbContext state, Cosmos DB improvements including enhanced support for configuration options and partition keys, and much more.
Database migrations help a developer to keep database schema up-to-date with the code. It is a core mechanism, that keeps changes in code and applies them in the database. Entity Framework Core 5 migrations are designed to keep track of DbContext class and generate migrations when you update it.
This article is being more efficient at configuring your EF Core DbContext that runs fast and safe. As a working freelance developer, I’m always looking for ways to make me a more efficient/faster developer. While configuring a DbContext is really important there can be a lot of configuration code, but over the years I have found ways to minimise or automate much of the EF Core configurations. This article pulls together lots of configuration approaches I have learnt working with EF Core, and EF6 before that.
Entity Framework Core 5 is a light and easy to use ORM, that let you use the database without writing any SQL commands. Built-in mechanisms will translate your LINQ queries on your entity classes to SQL queries and return mapped objects. Here is an article about adding EF Core with migrations to an empty database: PrimeHotel – adding Entity Framework Core 5 in .NET
Object Relational Mappers (ORMs) are great tools for abstracting our database choice away and allowing us to get things done. As time goes on and our applications evolve, we realize the underlying database can get things done faster and more efficiently. Not just that, we will notice features that can help us deliver value to our end users in new and exciting ways. I’m here to tell you that we can continue to use LINQ and utilize database functions together. In this post, we’ll see how we can configure Entity Framework Core (EF Core) to recognize existing database functions and also our custom database functions.
Today, the Entity Framework Core team announces the sixth preview release of EF Core 5.0. This release includes split queries for related collections, a new “index” attribute, improved exceptions related to query translations, IP address mapping, exposing transaction id for correlation, and much more.
这是深入理解 EF Core 系列的第二篇文章。第一篇是关于 EF Core 如何从数据库读取数据的；而这一篇是关于 EF Core 如何向数据库写入数据的。这是四种数据库操作 CRUD（新增、读取、更新和删除）中的 CUD 部分。我假设你对 EF Core 已经有了一定的认识，但在深入学习之前，我们先来了解一下如何使用 EF Core，以确保我们已经掌握了一些基本知识。这是一个“深入研究”的课题，所以我准备大量的技术细节，希望我的描述方式你能理解。
Today we are excited to announce the fourth preview release of Entity Framework Core (EF Core) 5.0. The fourth previews of .NET 5 and ASP.NET Core 5.0 are also available now. Be sure to check out the full release of Blazor WebAssembly 3.2.0!
In a perfect world, all of your EF Queries will be simplistic and not require complex logic, and the EF system itself will generate high-quality & performant queries in the process. Sadly, this utopia doesn't exist; however, tools are available, including PredicateBuilder that makes things work well...
Entity Framework Core 5 is a great ORM to use and connect to the database with. It is easy to use and easy to understand. It offers just enough for the most common scenarios. So what about inserting big amounts of data in a one go? Would it be fast enough?
EF Core 3 supports pluralization by convention, and allows you to enable and customize it. This blog post will show you how! When pluralization is enabled, you will by convention get pluralized DbSet and navigation property names...
In this post, we will see how to configure DbContext in Entity framework EFCore in ASP.NET Core. As we looked into our article on Repository implementation for Entity framework DbContext instance represents Unit Of Work and Repository patterns which can be used to query from a database and perform CRUD operations.
Today we are excited to announce the third preview release of EF Core 5.0. The third previews of .NET 5 and ASP.NET Core 5.0 are also available now. EF Core is distributed exclusively as a set of NuGet packages. For example, to add the SQL Server provider to your project, you can use the following command using the dotnet tool...
As a sort of follow up to my blog posts here and here I will show how to use a dynamic list of values a parameters when using FromSqlRaw. The condition in this case that you may sometimes be calling your method with 5 parameters, sometimes with 20 etc. Keep in mind that the maximum number of parameters with SQL Server is 2098!
EF Core 在 3.x 版本中增加了 Interceptor，使得我们可以在发生低级别数据库操作时作为 EF Core 正常运行的一部分自动调用它们。 例如，打开连接、提交事务或执行命令时。所以我们可以自定义一个 Interceptor 来记录执行的 sql 语句，也可以通过 Interceptor 来实现 sql 语句的执行。这里我们可以借助 Interceptor 实现对于查询语句的修改，自动给查询语句加 (WITH NOLOCK)，WITH NOLOCK 等效于 READ UNCOMMITED（读未提交）的事务级别，这样会造成一定的脏读，但是从效率上而言，是比较高效的，不会因为别的事务长时间未提交导致查询阻塞，所以对于大数据场景下，查询 SQL 加 NOLOCK 还是比较有意义的...