Top "Entity-framework-core" questions

Entity Framework (EF) Core is an open source multi-platform ORM developed by Microsoft.

Execute SQL command in Entity Framework Core 2.0 to delete all data in a table

I want to execute an SQL command from Entity Framework Core 2.0, but I can't figure out how to do so. 1.…

c# sql entity-framework-core asp.net-core-2.0
Database operation expected to affect 1 row(s) but actually affected 0 row(s)

I'm trying to insert records in two tables, but getting the exception. Could you please help me to resolve the …

c# asp.net-core ef-code-first entity-framework-core aspnetboilerplate
Mocking EF core dbcontext and dbset

I am using ASP.NET Core 2.2, EF Core and MOQ. When I run the test I am getting this error: …

c# unit-testing asp.net-core entity-framework-core moq
Configuring Dbcontext as Transient

In ASP.NET Core / EntityFramework Core, the services.AddDbContext<> method will add the specified context as a scoped …

c# asp.net-core entity-framework-core
AddDbContext or AddDbContextPool

For Asp.net Core apps, which one do we have to use? AddDbContext or AddDbContextPool? According to EF Core documentation, …

asp.net-core entity-framework-core asp.net-core-2.0
Saving many-to-many relationship in Entity Framework Core

For example, I have 3 classes, which I'm using for many-to-many relationship: public class Library { [Key] public string LibraryId { get; set; } …

c# many-to-many entity-framework-core
AddDbContext was called with configuration, but the context type 'MyContext' only declares a parameterless constructor?

In the following console application (.Net core 2.0), the scaffold-dbcontext created the following DbContext public partial class MyContext : DbContext { public virtual …

c# entity-framework .net-core entity-framework-core
Is there an Entity Framework 7 Database-First POCO Generator?

I've been playing around with Entity Framework 7 and ASP.NET 5 for a new project I'm working on, but I've hit …

c# sql-server asp.net-core entity-framework-core
How to set Entity Framework Core migration timeout?

I'm using the latest (1.0.0) version of EF Core. I have a migration to run on a quite big database. I …

c# entity-framework entity-framework-core
Entity Framework core - Contains is case sensitive or case insensitive?

"Contains" in Entity Framework core should equivalent to the SQL %like% operator. Therefore "Contains" should be case insensitive however it …

c# database postgresql linq entity-framework-core