717 questions with Entity Framework Core tags

Sort by: Updated
4 answers

How to fix Add-Migration problem?

Hi, I am trying to add another entity to the database in my e-commerce solution which includes client and admin projects using Blazor WASM and Server, Asp.Net Core API, and data access projects. However, I am getting an error message as shown below: How…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,336 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,471 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-24T17:33:35.47+00:00
Cenk 986 Reputation points
answered 2024-07-02T06:00:31.8533333+00:00
Cenk 986 Reputation points
1 answer

.Net core application with EFCore using Sqlite DB on linux giving error "Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 14: 'unable to open database file'."

I'm running a simple .Net Core application on Linux using EFCore and SQLite, but I'm getting the following error: An exception occurred while iterating over the results of a query for context type 'ApplicationDbContext'. …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2024-06-27T05:27:57.4366667+00:00
Hrushikesh Patel 0 Reputation points
commented 2024-07-01T20:01:00.1066667+00:00
Bruce (SqlWork.com) 60,201 Reputation points
3 answers

EF Core - High Memory Usage For Query that Runs for 20 seconds

I'm wondering if there is a better way to optimize the below query. Granted, it's pulling in 80,000 - 160,000 records, but the RAM usage on my web server, shoots up to ~3gig while it's running for a total of 20 seconds, when testing it in my API, but,…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-29T05:22:38.7933333+00:00
muttBunch 100 Reputation points
answered 2024-07-01T16:52:22.3433333+00:00
Bruce (SqlWork.com) 60,201 Reputation points
1 answer

EntityFrameworkCore 7 SetProperty(avar,avalue) Unable to cast object of type 'System.Linq.Expressions.TypedParameterExpression' to type 'System.Linq.Expressions.LambdaExpression'.

My code: 1.Error ADal aDal = new ADal(); Func<AModel, float> p = property => property.Balance; aDal._databaseContext .ModelDbSet .Where(w => w.ID == 5) .Take(1) .ExecuteUpdate(e => e.SetProperty(p, 636)); Out error (Almost no answer…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,566 questions
asked 2023-07-25T11:47:25.1166667+00:00
Allen 5 Reputation points
commented 2024-06-30T12:18:02.7566667+00:00
İsa Sayın 0 Reputation points
0 answers

EF Core .Net 8 error after TLS 1.0 was disabled.

The admins where I work have disabled TLS 1.0 but now all of a sudden, my .Net 8 app is getting the following error: Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2023-12-05T17:06:22.9333333+00:00
Lange Gregory 20 Reputation points
commented 2024-06-29T13:43:40.4933333+00:00
Umut Çömlekçioğlu 0 Reputation points
2 answers One of the answers was accepted by the question author.

Queries with EF Core causes 'Cannot continue the execution because the session is in the kill state'

Some EF Core queries are throwing the following error in our code : Cannot continue the execution because the session is in the kill state. Une erreur grave s'est produite pendant la commande actuelle. Les résultats devront être supprimés, le cas…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,181 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-07T10:02:04.1466667+00:00
Arthur Menétrey 20 Reputation points
answered 2024-06-26T08:48:21.2633333+00:00
Arthur Menétrey 20 Reputation points
1 answer One of the answers was accepted by the question author.

How to exclude matching records in EF Core Database

I've been working on a project from a gentleman that is no longer on my team. We want to have the below code running as a Windows Service, running every 5 minutes (easy for me to do the Service). However, if we run the below code in our API, manually…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-20T04:43:10.63+00:00
muttBunch 100 Reputation points
commented 2024-06-23T05:41:37.58+00:00
muttBunch 100 Reputation points
1 answer

Access failed to localdb using EFCore in vs2022

Hi, I created my first Avalonia UI app in MVVM pattern and already installed EFCore 8.0.6 in the project. But failed to access the localdb. My troubleshoot: Created a simple console project. No issue. See attached pic1. In Avalonia app, checked the…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2024-06-22T23:16:10.8533333+00:00
Spellman.Lau 101 Reputation points
answered 2024-06-22T23:28:05.5133333+00:00
Spellman.Lau 101 Reputation points
2 answers One of the answers was accepted by the question author.

My EmailConfirmed is not working

Hi, I'm new to this, so I'm not so good, your help is my pleasure, thank you. I am having a problem with login, the API emailConfirmed still works when I give it token and userId. As far as I know, the EmailConfirmed doesn't confirm itself. I think I…

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
645 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,336 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-20T20:04:22.7933333+00:00
Nhựt Lại 45 Reputation points
accepted 2024-06-21T15:22:48.6833333+00:00
Nhựt Lại 45 Reputation points
1 answer One of the answers was accepted by the question author.

A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext

I have a project using Azure Function with ASP.NET Core 8 and Service Bus, for data access I use EF Core. I'm getting hit a lot and we still haven't found the cause of the error: "A second operation was started on this context instance before a…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
575 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,552 questions
asked 2024-06-17T17:33:53.32+00:00
Pedro Otávio 20 Reputation points
accepted 2024-06-19T10:57:18.12+00:00
Pedro Otávio 20 Reputation points
1 answer

Entity Framework bulk functionalities (bulk insert,bulk delete)

I'm currently working on an enterprise project that requires some logic for bulk functionalities using Entity Framework. We found a couple of options but both are under licence: EF. Core.BulkExtensions…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2024-02-19T21:21:00.5366667+00:00
Greivin Chaves 0 Reputation points
commented 2024-06-19T09:59:41.4+00:00
David V. Corbin [Atmosera] 6 Reputation points
3 answers One of the answers was accepted by the question author.

Which is better to use, DbContext.Add() or DbSet.Add()?

Hi, If you allow, I would like to ask a question. In CRUD operations, we can add to the database in two ways: DbContext.Add(object) and DbSet.Add(object). Which one is more correct to use? public class Context : DbContext { public DbSet<Category>…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-10T07:02:43.7566667+00:00
Yalçın Mete 60 Reputation points
accepted 2024-06-10T08:12:51.1433333+00:00
Yalçın Mete 60 Reputation points
3 answers

How to filter a query in EF Core using a Value Object (Email value object) and the filter using Contains method?

I'm using C# EF Core version 7. I have a value object called Email which contains a string Value getter property which will hold the email value, and i have entity called Person which have Id and email i have configuered my entity using fluent api as…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2023-11-09T11:44:30.2966667+00:00
Osama Al-qarutee 0 Reputation points
answered 2024-06-08T16:07:53.16+00:00
Mobin Valikhani 0 Reputation points
1 answer

My listview is listing only the id instead of 3 items on the table

PLEASE HELP ME I am working on sqlite database , i have the following code in c# maui return (await conn.Table

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,134 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-05-28T15:40:05.35+00:00
Gbenga Banuso Odumosu 40 Reputation points
edited the question 2024-06-06T06:34:54.62+00:00
Rakesh Gurram 5,070 Reputation points Microsoft Vendor
0 answers

System.Reflection.TargetInvocationException: "Expression 'dest => dest' must resolve to top-level member" when configuring AutoMapper profile

I'm encountering an exception when trying to configure AutoMapper in my ASP.NET Core application. The exception message is: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,566 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,336 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2024-06-01T08:50:47.3466667+00:00
Julia Ohorodnichuk 0 Reputation points
commented 2024-06-03T09:34:57.7866667+00:00
Ping Ni-MSFT 3,040 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Unable to create a DbContext' Error when Using EF Core in .NET 8 ClassLibrary Project

Hello everyone, I've developed a ClassLibrary project using .NET 8 and C#, and I've utilized EF Core 8 in it. I've defined my own models and context within it. However, when I attempt to use the add-migration command, I encounter this error: "Unable…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,566 questions
asked 2024-06-01T01:35:11.9766667+00:00
Kamyab Faghih 20 Reputation points
accepted 2024-06-03T06:19:13.0333333+00:00
Kamyab Faghih 20 Reputation points
1 answer One of the answers was accepted by the question author.

How do I store a negative TimeSpan in Entity Framework?

Hi all; I store shifts to events with a TimeSpan as the offset from the start of the event and another TimeSpan as the duration of the shift. The setup shift starts before the event (so everyone see the event as 11:00am - 4:00pm as desired while the…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
asked 2024-06-02T02:42:02.63+00:00
David Thielen 2,506 Reputation points
accepted 2024-06-02T16:17:29.5566667+00:00
David Thielen 2,506 Reputation points
2 answers

EF Core 3.1 - System.InvalidOperationException: 'The entity type 'Pntbec03' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.'

Hello . I need to handle a EF Core Entity relating to a table , but without having EF managing all its columns , but just a subset of them. I have scaffolded the small database to which the table belongs into a DbContext , and I though I could create…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,566 questions
asked 2024-05-29T13:46:26.23+00:00
leo del ciello 66 Reputation points
commented 2024-05-31T08:41:09.6033333+00:00
Hongrui Yu-MSFT 780 Reputation points Microsoft Vendor
2 answers

How to retrieve the any table from SQL DB and display dynamically in one page in asp.net core

Requirements are as below. 1. In single page of asp.net core, need to display any table data dynamically like jtable from jQuery plugin... With generic code with ado.net or web api orAPI or entity framework core

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,336 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,564 questions
asked 2023-04-02T16:30:01.65+00:00
phani sekhar 1 Reputation point
commented 2024-05-30T02:09:18.2166667+00:00
Hutty 20 Reputation points
2 answers

Is it correct to make connection string dynamic?

Hi, I'm currently working on a project which need data from other databases. The database where I'll get the datas are depends on users. Now I want to make my connectionString dynamic. Is it correct to make connection strnig dynamic. The user will enter…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
717 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,181 questions
asked 2024-05-20T19:12:10.4966667+00:00
Atilla Rüstəmli 20 Reputation points
edited the question 2024-05-28T01:33:06.14+00:00
Zhi Lv - MSFT 32,071 Reputation points Microsoft Vendor