710 questions with Entity Framework Core tags

Sort by: Updated
1 answer

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.
710 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,037 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,458 questions
asked 2024-06-07T10:02:04.1466667+00:00
Arthur Menétrey 0 Reputation points
commented 2024-06-11T02:55:34.25+00:00
LiHongMSFT-4306 24,266 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.
710 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,458 questions
asked 2024-06-10T07:02:43.7566667+00:00
Yalçın Mete 20 Reputation points
accepted 2024-06-10T08:12:51.1433333+00:00
Yalçın Mete 20 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.
710 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.
710 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,039 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,458 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 4,320 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.
710 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,513 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 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,458 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 2,640 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.
710 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,513 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.
710 questions
asked 2024-06-02T02:42:02.63+00:00
David Thielen 2,421 Reputation points
accepted 2024-06-02T16:17:29.5566667+00:00
David Thielen 2,421 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.
710 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,513 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 575 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.
710 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 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,458 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 0 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.
710 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,037 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,051 Reputation points Microsoft Vendor
0 answers

how to solve:An unhandled exception occurred while processing the request. SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Doctors_Users_UserId".

An unhandled exception occurred while processing the request. SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Doctors_Users_UserId". The conflict occurred in database "Diabetes2AppDb", table…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 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,458 questions
asked 2024-05-26T19:23:31.6466667+00:00
karen matungwa 0 Reputation points
commented 2024-05-27T09:12:14.18+00:00
Hongrui Yu-MSFT 575 Reputation points Microsoft Vendor
0 answers

probleme mise a jour windows server 2019

bonjour, j'ai un probleme de mise a jour sous Windows Server 2019 mon serveur de domaine apres l'installation des mise a jour , j'ai recu deux messages d'erreurs j'ai besoin de votre aide svp 1- 2023-09 Mise à jour cumulative pour .NET Framework 3.5,…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,537 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,513 questions
asked 2023-10-18T12:59:23.5666667+00:00
saber 0 Reputation points
commented 2024-05-24T11:38:59.2766667+00:00
saber 0 Reputation points
2 answers

EF Core doesn't recognize many-to-many relationship

I have a many-to-many relationship, altough EF Core seems not to recognize it. The relationship exists between JobOffer and JobOfferTag. JobOffer inherits from BaseJobOffer. BaseJobOffer.cs public class BaseJobOffer { [Required] …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 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,458 questions
asked 2024-05-23T15:23:05.96+00:00
iKingNinja 60 Reputation points
answered 2024-05-24T07:21:04.53+00:00
Hongrui Yu-MSFT 575 Reputation points Microsoft Vendor
2 answers

framework realated question

what is frame in framework for .net applicatons like .net framework 3.5 and what it indicates for frames

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,358 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,037 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,458 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
311 questions
asked 2024-05-10T16:37:37.01+00:00
Siddangoud Bharamagoudar 61 Reputation points
commented 2024-05-24T07:17:27.83+00:00
Lan Huang-MSFT 27,716 Reputation points Microsoft Vendor
5 answers

SQLAzure is not available for your selection of subscription and location

Hi Folks, Trying to use Azure for the first time, I'm using a normal account (i.e not free tier or student) but it is just for a hobby project. I'm following the tutorial here in order to deploy my EFCore webapi…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 questions
asked 2023-01-22T08:33:29.6833333+00:00
Gary Frewin 25 Reputation points
commented 2024-05-23T20:19:04.16+00:00
Jason Porter 1 Reputation point
2 answers

EF is not creating a MigrationsHistory table

Hi all; I've been using Entity Frameworks for some time with my app. And I just noticed, there is no MigrationsHistory table. I looked at the files in core/Migrations and none of them create a MigrationsHistory table. Why is it missing and how do I get…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
asked 2024-05-16T15:06:13.2033333+00:00
David Thielen 2,421 Reputation points
commented 2024-05-23T07:04:40.7233333+00:00
Hongrui Yu-MSFT 575 Reputation points Microsoft Vendor
1 answer

Invalid Argument while scaffolding DB2 schema EF 3.1

Hello. I am trying to scaffold a DB2 schema using the IBM.EntityFrameworkCore provider (version 3.1.0.300) on an AspNet Core 3.1 web application using EntityFramework Core 3.1. The scaffolding command line is the following : Scaffold-DbContext…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
asked 2024-05-17T07:05:32.1933333+00:00
leo del ciello 66 Reputation points
answered 2024-05-17T07:26:29.47+00:00
leo del ciello 66 Reputation points
4 answers One of the answers was accepted by the question author.

Blazor Server: It is possible get Current Loged User In DbContext

Hello, I build blazor server multi tenant application and I wants to use HasQueryFilter in entity framework DbContext for predefined filter with TenantId. But I cannot get Current Loged User in DbContext. I inject to DB Context…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 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,448 questions
asked 2021-03-17T08:54:54.227+00:00
Jan Mucha 101 Reputation points
answered 2024-05-15T11:09:34.7366667+00:00
james biyond 0 Reputation points
1 answer

Issues with EF Update Command and Azure Credentials in ASP.NET Core Application

I am encountering errors while attempting to run an Entity Framework (EF) update command (dotnet ef database update) from my ASP.NET Core application. The application is connected to a database hosted on Azure. After executing the EF update command, I am…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
Azure SQL Database
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 questions
asked 2024-05-09T18:29:21.49+00:00
Yamen Edel 0 Reputation points
answered 2024-05-10T16:22:42.6+00:00
Yamen Edel 0 Reputation points
4 answers

saving the Identity token in the Aspnetusertokens table

Hi I created an Asp.net core 6 project and I added the Identity framework for authentication and authorization, I would like to add token management and while doing research I realized that Identity also manages the management of tokens because it…

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.
633 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,795 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,280 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,458 questions
asked 2023-11-07T11:19:50.1566667+00:00
Marnelle M'BENGUET 20 Reputation points
edited a comment 2024-05-07T17:33:51.2333333+00:00
Bruce (SqlWork.com) 59,016 Reputation points