32 热度

How to call stored procedures with OUTPUT parameters with FromSqlRaw in EF Core

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.

收录时间: 2020-08-06
贡献者: Rector
53 热度

Merging migrations in Entity Framework Core 5

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.

收录时间: 2020-07-25
贡献者: Rector
61 热度

Announcing Entity Framework Core EF Core 5.0 Preview 7

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.

收录时间: 2020-07-23
贡献者: Rector
43 热度

Adding Entity Framework Core 5 migrations to .NET 5 project

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.

收录时间: 2020-07-23
贡献者: Rector
48 热度

EF Core In depth – Tips and techniques for configuring EF Core

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.

收录时间: 2020-07-18
贡献者: Rector
57 热度

Adding an Entity Framework Core 5 to an existing database

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

收录时间: 2020-07-18
贡献者: Rector
AD 友情赞助
52 热度

Add Custom Database Functions For Entity Framework Core

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.

收录时间: 2020-07-13
贡献者: Rector
82 热度

Announcing Entity Framework Core EFCore 5.0 Preview 6

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.

收录时间: 2020-06-30
贡献者: Rector
102 热度

深入理解 EF Core:EF Core 写入数据时发生了什么?

这是深入理解 EF Core 系列的第二篇文章。第一篇是关于 EF Core 如何从数据库读取数据的;而这一篇是关于 EF Core 如何向数据库写入数据的。这是四种数据库操作 CRUD(新增、读取、更新和删除)中的 CUD 部分。我假设你对 EF Core 已经有了一定的认识,但在深入学习之前,我们先来了解一下如何使用 EF Core,以确保我们已经掌握了一些基本知识。这是一个“深入研究”的课题,所以我准备大量的技术细节,希望我的描述方式你能理解。

收录时间: 2020-06-19
贡献者: Rector
78 热度

深入理解 EF Core:EF Core 读取数据时发生了什么?

本文将为你详细描绘 EF Core 从数据库中读取数据的“幕后”视图。我将揭开两种数据库读取方式的面纱:一个是普通的查询,另一个是使用 AsNoTracking 方法的非跟踪查询。我还将通过一个实验来演示我是如何解决我的一个客户遇到的性能问题。

收录时间: 2020-06-17
贡献者: Rector
93 热度

Announcing Entity Framework Core 5.0 Preview 5

Today we are announcing the fifth preview release of EF Core 5.0. The fifth previews of .NET 5 and ASP.NET Core 5.0 are also available now.

收录时间: 2020-06-11
贡献者: Rector
99 热度

Announcing Entity Framework Core 5.0 Preview 4

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!

收录时间: 2020-05-21
贡献者: Rector
153 热度

Using PredicateBuilder with EF Core for Complex Queries

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...

收录时间: 2020-05-05
贡献者: Rector
123 热度

Entity Framework Core 5 vs SQLBulkCopy

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?

收录时间: 2020-05-05
贡献者: Rector
183 热度

Pluralization with EF Core and EF Core Power Tools

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...

收录时间: 2020-04-29
贡献者: Rector
AD 友情赞助
177 热度

Configuring DbContext in Entity framework ASP.NET Core

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.

收录时间: 2020-04-26
贡献者: Rector
166 热度

Announcing Entity Framework Core 5.0 Preview 3

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...

收录时间: 2020-04-24
贡献者: Rector
144 热度

How to pass a dynamic/variable list of values as SqlParameters with FromSqlRaw in EF Core

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!

收录时间: 2020-04-22
贡献者: Rector
178 热度

Announcing Entity Framework Core 5.0 Preview 2

Today we are excited to announce the second preview release of EF Core 5.0. The second previews of .NET 5 and ASP.NET Core 5.0 are also available now.

收录时间: 2020-04-04
贡献者: Rector
217 热度

给 EF Core 查询增加 With NoLock

EF Core 在 3.x 版本中增加了 Interceptor,使得我们可以在发生低级别数据库操作时作为 EF Core 正常运行的一部分自动调用它们。 例如,打开连接、提交事务或执行命令时。所以我们可以自定义一个 Interceptor 来记录执行的 sql 语句,也可以通过 Interceptor 来实现 sql 语句的执行。这里我们可以借助 Interceptor 实现对于查询语句的修改,自动给查询语句加 (WITH NOLOCK),WITH NOLOCK 等效于 READ UNCOMMITED(读未提交)的事务级别,这样会造成一定的脏读,但是从效率上而言,是比较高效的,不会因为别的事务长时间未提交导致查询阻塞,所以对于大数据场景下,查询 SQL 加 NOLOCK 还是比较有意义的...

收录时间: 2020-04-03
贡献者: Rector
AD 友情赞助