700 questions with Entity Framework Core tags

Sort by: Updated
1 answer

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.
700 questions
asked 2024-05-16T15:06:13.2033333+00:00
David Thielen 2,286 Reputation points
edited a comment 2024-05-20T06:51:59.2366667+00:00
Hui Liu-MSFT 40,866 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.
700 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.
700 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,411 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
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.
700 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,303 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.
12,853 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,360 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.
303 questions
asked 2024-05-10T16:37:37.01+00:00
Siddangoud Bharamagoudar 61 Reputation points
answered 2024-05-13T02:36:40.6266667+00:00
Lan Huang-MSFT 26,121 Reputation points Microsoft Vendor
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.
700 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,228 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.
624 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 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,619 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,228 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,360 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) 57,646 Reputation points
1 answer

Microsoft.EntityFrameworkCore.SQLServer 8.0.1 (latest version) has High vulnerabilities on its transitive dependencies. When will we have another patch released with no vulnerabilities on its transitive dependencies?

Microsoft.EntityFrameworkCore.SQLServer 8.0.1 (latest version) has High vulnerabilities due to transitive dependencies on Azure.Identity 1.7.0 and Microsoft.Data.SQLClient5.1.1. Both these dependent packages have a non vulnerable latest version. …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,439 questions
asked 2024-01-24T18:30:07.4066667+00:00
seshan 0 Reputation points
commented 2024-05-06T17:28:48.04+00:00
Bruce (SqlWork.com) 57,646 Reputation points
5 answers

Error: 'Package restore failed rolling back package change for' while running Scaffold-Dbcontext in Entity Framework Core 7.0.14

Hello, I'm working on a project using .NET Core 7 and encountering an issue when running Scaffold-DbContext with Entity Framework 7.0.14. The error message I'm getting is "there was an error running the selected code generator package restore failed…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,228 questions
asked 2023-12-19T20:12:20.84+00:00
UMUT CAN 5 Reputation points
answered 2024-05-01T12:35:50.3466667+00:00
Ian Hewitt 0 Reputation points
1 answer One of the answers was accepted by the question author.

Maui .Net 8 XCode 15.1 and 15.2 NativeAOT Error in Testflight

Hello, I have an Maui app built with XCode 15.2 and .Net 8. I am using Microsoft.EntityFrameworkCore.Sql V8.0.4 When I install it on my iPad with test flight I get: Model binding is not supported when publishing with NativeAOT. Use a compiled model. I…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,961 questions
asked 2024-04-19T16:55:14.02+00:00
Grant Schaffer 25 Reputation points
accepted 2024-04-30T16:08:27.4133333+00:00
Grant Schaffer 25 Reputation points
1 answer

How to fix DbContextOptions resolving properly from services to apply EF migration to create database?

I'm trying to run a migration to create my initial database from code, but i'm having difficulties with proper registration of DbContextOptions. My program.cs contains the service registration: var builder = WebApplication.CreateBuilder(args); // Add…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
asked 2024-04-05T22:58:14.0533333+00:00
Vatai Domonkos 10 Reputation points
commented 2024-04-24T03:22:33.8766667+00:00
Jack J Jun 24,296 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

How do I find the method calling Entity Framework that led to an exception

I believe this call is coming from the ASP.NET Identity Library. However, it may be coming from my Blazor code. The below is the entire exception written to the log. How do I find out what method (Identity library or my Blazor code) is calling this? …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,228 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,411 questions
asked 2024-04-19T20:39:54.0166667+00:00
David Thielen 2,286 Reputation points
commented 2024-04-19T21:29:36.8466667+00:00
David Thielen 2,286 Reputation points
1 answer

Learning EF - Error running Scaffold-DbContext

I am learning how to user Entity Framework where the models are built from an existing SQL server. I ran this command in the package manager: Scaffold-DbContext “Server=xxx; database=Contoso; user id = cnnxxxxx; password = xxxx”…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
asked 2023-02-07T22:47:49.0433333+00:00
Stephen Ng Qui Sang 10 Reputation points
edited a comment 2024-04-13T20:52:12.7133333+00:00
Yash Jha 0 Reputation points
0 answers

How can we debug with InMemoryDatabase and how can we know exactly the key is duplicate?

How can we debug with InMemoryDatabase Unit test? Also I have question that when I get this error for example "An item with the same key has already been added. Key: 16c568e8-b00d-46b2-ab27-cdb7685839ae" why VS don't point exactly what entity…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,228 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,673 questions
asked 2024-04-10T08:27:15.02+00:00
Kha Vo 0 Reputation points
commented 2024-04-11T10:16:47.4033333+00:00
AgaveJoe 26,161 Reputation points
1 answer

An issue implementing migrations in the data layer

Hello I started developing a new c# WPF project. In a solution, I separated the layers as UI and Data. I placed database-related models and configurations in the data layer. Then, I gave the Data project as a reference to the ilse UI project. The problem…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,685 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,360 questions
asked 2024-04-05T08:04:08.8033333+00:00
fatih uyanık 80 Reputation points
commented 2024-04-08T05:33:09.8066667+00:00
Jiale Xue - MSFT 35,556 Reputation points Microsoft Vendor
2 answers

Nuget and The package manager on VS 2022 Community edition cannot find the Microsoft.EntityFrameworkCore

Typing Microsoft.EntityFrameworkCore into the Nuget package manager returns nothing and instead displays the NO package found message. The PM console prints the following error text when NuGet\Install-Package Microsoft.EntityFrameworkCore -Version 8.0.3…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
asked 2024-03-25T19:29:09.87+00:00
Jason Starbuck 0 Reputation points
edited the question 2024-04-02T10:00:47.44+00:00
Zhi Lv - MSFT 32,036 Reputation points Microsoft Vendor
2 answers

Single transaction, multiple service calls to Entity Framework updating database

Hi all; I have a case with a single database defined by a single Entity Framework DbContext. I have things set up where updating the database is via services. This separates things out nicely and makes it easy to mock the database for the bUnit (Blazor…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
asked 2024-03-22T15:46:31.9333333+00:00
David Thielen 2,286 Reputation points
answered 2024-04-01T20:13:59.5533333+00:00
Bruce (SqlWork.com) 57,646 Reputation points
1 answer One of the answers was accepted by the question author.

How do I create a NetTopologySuite.Polygon from a Atlas.BoundingBox?

Hi all; I need to create a Polygon so that in my Entity Framework query I can do: point.Intersects(polygon) The code to create the point is: var center = new TopologyPoint(longitude, latitude) { SRID = 4326 }; I think the code to create the…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 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.
12,853 questions
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
600 questions
asked 2024-03-26T01:11:02.51+00:00
David Thielen 2,286 Reputation points
commented 2024-04-01T18:21:58.51+00:00
rbrundritt 15,471 Reputation points Microsoft Employee
2 answers One of the answers was accepted by the question author.

Can I share a List<T> property across multiple queries via a tracking DbContext?

Hi all; Will the following work? And if so, will it provide a significant performance improvement. My AppUser object includes: public class AppUser { public int Id { get; private set; } // lots of other properties public List<Tag>?…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
asked 2024-04-01T11:06:30.0166667+00:00
David Thielen 2,286 Reputation points
commented 2024-04-01T17:20:51.4133333+00:00
David Thielen 2,286 Reputation points
1 answer One of the answers was accepted by the question author.

how to fix the error occuring when trying the Update-Database command

when I try the command Update-Database i get the error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,439 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,673 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.
12,853 questions
asked 2024-04-01T12:10:03.4133333+00:00
NISSOU09 40 Reputation points
commented 2024-04-01T12:45:27.4733333+00:00
NISSOU09 40 Reputation points
1 answer

Add-Migration works, but Update-Database says "no migrations to update". I tried deleting the Mig.. Folder

Visual Studio and EF Core problem. Migrations don't work. Add-Migration Title works to update the schema, but Update-Database in NuGet Command Console says that the db is already up to date, but the db does not have my new table in it. I tried…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 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.
12,853 questions
asked 2023-12-31T01:49:00.7366667+00:00
John Murphy 25 Reputation points
edited a comment 2024-04-01T02:49:23.5733333+00:00
John Murphy 25 Reputation points