743 questions with Entity Framework Core tags

Sort by: Updated
2 answers

Getting an error :Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Tried trouble shooting , verfied DB context class. Reinstalled Vs after troubleshooting and getting answers saying there is a problem with package manager .

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 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,865 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,962 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,723 questions
asked 2023-05-19T13:51:47.28+00:00
Shyamali Mishra 0 Reputation points
commented 2024-08-23T16:23:01.12+00:00
Robert L. Bonham 10 Reputation points
1 answer

Entity Framework Core 8, table with a user-defined data type. UDT

We are migrating a 4.5 large application which uses sql data reader to query the MS SQL database to .NET 8 EF core. The database has at least one user-defined column, code below. There is currently 20 years of data in the database. We are migrating…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 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,865 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,962 questions
asked 2024-08-13T22:25:33.4133333+00:00
Phil Alexander 0 Reputation points
edited a comment 2024-08-23T06:26:00.3766667+00:00
Hui Liu-MSFT 48,546 Reputation points Microsoft Vendor
1 answer

how to include a spatial index in c# EF

This query is not using the spatial index: (@__point_0 sys.geometry)SELECT TOP(1) [t].[Id], [t].[Bus_StopsId], [t].[Point] FROM [TripRef_Stops] AS [t] WHERE [t].[Point].STBuffer(5.0000000000000002E-05).STContains(@__point_0) = CAST(1 AS bit) - it is…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 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,962 questions
asked 2024-08-21T11:02:07.8466667+00:00
Stephen Cameron 0 Reputation points
answered 2024-08-22T09:23:09.54+00:00
Stephen Cameron 0 Reputation points
1 answer

Using Enity Framework 6.1 and initial query VERY slow.

When performing the initial query using EF, it can take up to 9 mins. Though if you rerun it again and again it takes seconds. If I capture the query from the profiler, it always runs in seconds. If I wait about 10 / 15 mins the slow initial process…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 questions
asked 2024-08-07T19:04:09.36+00:00
Gary Paquette 0 Reputation points
commented 2024-08-19T07:23:00.14+00:00
Hongrui Yu-MSFT 2,075 Reputation points Microsoft Vendor
2 answers

Map only the selected columns when using EntityFramework

In my recent Entity Core project I am having database table called "YmPlant" and it has 20+ columns. But for my requirement I just need data only from 3 columns. Also I am not required to do the write operations. Only read from YmlPlant table. …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 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,962 questions
asked 2022-09-23T17:53:48.407+00:00
Nuwan Wickramanayaka 21 Reputation points
commented 2024-08-13T18:17:09.9733333+00:00
John Viele 0 Reputation points
2 answers

How to Optimize Database Interactions in Entity Framework Core?

I am using Entity Framework Core for database interactions in my .NET application. I am seeking advice on optimizing database queries and transactions for better performance and efficiency. Any tips or best practices would be appreciated.

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 questions
asked 2023-09-23T16:04:26.41+00:00
Kevin Beasley 0 Reputation points
commented 2024-08-05T08:31:08.99+00:00
Nubbi 0 Reputation points
2 answers

.Net Framework > .Net Migration Problem - Incremental upgrade with Entity Framework 6.4.4

Hi, (apologies for the lengthy description) I'm working on setting a roadmap for a phased/incremental upgrade path of a .Net Framework 4.8 solution to .Net 8.0+. The existing solution has a large number of projects with direct project references and has…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,163 questions
asked 2024-07-19T15:40:33.36+00:00
AndyB 0 Reputation points
answered 2024-07-29T16:20:11.24+00:00
Bruce (SqlWork.com) 65,576 Reputation points
2 answers One of the answers was accepted by the question author.

How to use EF Core when two properties in the Principle entity point to the same attribute in the dependent entity?

I have 2 Model classes: Department.cs cs public class Department { public string DepartmentId { get; set; } public string Name { get; set; } public string Description { get; set; } [ForeignKey("FacultyId")] public…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 questions
asked 2021-11-01T04:16:37.687+00:00
Uchchay Dugal 21 Reputation points
answered 2024-07-24T21:30:32.9566667+00:00
Hazrat Ali 0 Reputation points
1 answer One of the answers was accepted by the question author.

Invalid UserName in ASP.NET Core 6

I am working on an ASP.NET Core 6 MVC application that uses ASP.NET Core Identity. When I try to create a new user using the UserManager, I get this error: User name ' ' is invalid, can only contain letters or digits Username do not has any…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 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,962 questions
asked 2024-07-22T09:02:47.1366667+00:00
mostafa ahmed 41 Reputation points
accepted 2024-07-23T22:36:34.12+00:00
mostafa ahmed 41 Reputation points
2 answers

Cycling problem

Hi, I have 2 entity which have one to many relation between. Lets name them School and student. When I'm creating School I'm getting cycling problem . I did all the configuration in Configure class but nothing worked. There is a way with [JsonIgnore] but…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 questions
asked 2024-07-16T19:06:27.2733333+00:00
Atilla Rüstəmli 40 Reputation points
edited a comment 2024-07-18T02:36:48.31+00:00
SurferOnWww 2,906 Reputation points
3 answers One of the answers was accepted by the question author.

This error appears to me. I use .NET 8. The project is divided into three layers. The presentation layer is a web project. The rest of the layers are class libraries. I installed the necessary libraries, all of which are version 8.

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 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,962 questions
asked 2024-07-16T20:30:25.5766667+00:00
saleh salem 20 Reputation points
commented 2024-07-17T23:07:23.29+00:00
saleh salem 20 Reputation points
2 answers

How to get license terms for Entity Framework 4.3.0 nuget package and also source code?

Hello, I am not sure if this is right forum for this question. What i need is the license terms from Microsoft for using the Entity Framework 4.3.0 nuget package in the application which is disctributed commercially. Also, since Entity Framework is…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,163 questions
asked 2024-07-17T15:15:38.5833333+00:00
Shinde, Kalpana 0 Reputation points
answered 2024-07-17T15:52:12.2333333+00:00
Bruce (SqlWork.com) 65,576 Reputation points
1 answer

EF Core AUTO_INCREMENT problem with MySQL database

The only problem i have now that i finished my database design is that the AUTO_INCREMENT is not specified when creating the tables by EF Core. This is the modelBuilder modelBuilder.Entity<Conturi>(entity => { …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2024-07-11T22:03:48.4833333+00:00
Stefan 0 Reputation points
commented 2024-07-17T01:20:36.5766667+00:00
Hongrui Yu-MSFT 2,075 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Entity Framework complains that there is no primary key

using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace WpfApp6.Models; public partial class Product [Key] public int IdProduct { get; set; } public string NameOfProduct { get; set; } = null!; public…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 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,781 questions
asked 2024-07-09T20:27:16.29+00:00
vitaminchik 486 Reputation points
edited the question 2024-07-16T16:41:14.8+00:00
DillanSimmons 1 Reputation point
1 answer

Inserting data in many to many relation ship in EF core

i have two tables 1-Employees (ID ,EmpName) 2- Project (ID,ProjectName) data is already inserted in boh tables ,there is many to many relationship between these two so middle table created in table i.e EmployeesProject now i want to insert data (keys of…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2023-06-05T15:28:34.3533333+00:00
Erum Mirza 6 Reputation points
commented 2024-07-14T05:23:28.2933333+00:00
Aviad Pineles 20 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.
743 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,865 questions
asked 2023-12-31T01:49:00.7366667+00:00
John Murphy 30 Reputation points
commented 2024-07-13T02:11:37.22+00:00
Mario Escudero 0 Reputation points
2 answers One of the answers was accepted by the question author.

How can I save a collection of CultureInfo type using EF Core without adding backing fields?

In a class, I have a collection of type List<CultureInfo> OfficialLanguages. I need to respect domain driven design for this project. I cannot add a backing field of type List<string> officialLanguagesCodes and handle it that way. When I have…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2024-07-04T01:15:48.8333333+00:00
Joseph Gregory 20 Reputation points
accepted 2024-07-10T19:00:32.5666667+00:00
Joseph Gregory 20 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.
743 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,962 questions
asked 2024-06-29T05:22:38.7933333+00:00
muttBunch 100 Reputation points
edited an answer 2024-07-09T15:36:32.0133333+00:00
Bruce (SqlWork.com) 65,576 Reputation points
1 answer

BulkInsert for Entity Framework Core

Entity Framework core now has ExecuteUpdate and ExecuteDelete for doing large updates and deletes But when is EF core going to get the much need BulkInsert that does the job of SQL SERVER's BCP There are third party tools, but they are very expense…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2024-07-03T23:37:18.52+00:00
Greg Frazer 0 Reputation points
commented 2024-07-08T02:54:29.49+00:00
Hongrui Yu-MSFT 2,075 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

How to save a many to many relationship with Entity Framework

Hi, I have a many to many relationship between Flight and Journey, so I have created an intermediate table to create the relationship: the thing is, I have a list of flights and one Journey, so how can I create the code to make the assembly so I can…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 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,962 questions
asked 2023-03-21T00:31:43.34+00:00
Jhon Hernandez 21 Reputation points
answered 2024-07-04T08:59:22.9033333+00:00
MARTIN JOY 0 Reputation points