Skip to main content

Questions tagged [entity-framework]

For questions about Entity Framework for .NET Framework, max. version 6.5.1, (6/17/2024). Use [entity-framework-core] for current .NET versions., accompanied by a version-specific [ef-core-xx] tag.

Filter by
Sorted by
Tagged with
1 vote
2 answers
71 views

I keep getting error .DrpString.Contains(dienstregelpunt)' could not be translated. I have a string[] dienstregelpunten array and a database field containng ...
Joost V.'s user avatar
-1 votes
0 answers
61 views

I'd like to create a table in my SQL Server. My entity in code contains multiple nested value objects. My Student table is a temporal table. All properties and ...
trophi20's user avatar
2 votes
1 answer
131 views

I have a list of records, by multiple UserID's. ...
Sherry8212's user avatar
Tooling
0 votes
4 replies
92 views

I’m used to working with a Database First approach in C#. I design my database schema (often with MySQL Workbench) and do a forward engineering, then generate my C# models using Entity Framework’s. ...
alex_pythooon's user avatar
4 votes
2 answers
499 views

I tried adding a migration via dotnet ef migrations add InitialCreate but got the following error ...
Trevor Stauffer's user avatar
Advice
0 votes
2 replies
52 views

Here's a basic example from the official .NET documentation for a many-to-many relationship using EF and .NET: ...
Arnaud VDR's user avatar
1 vote
4 answers
223 views

I am looking for a way to use the .Include clause of Entity Framework while avoiding duplicate code. I have a lot of classes, and every class has a method which ...
Karsten Heimer's user avatar
2 votes
1 answer
92 views

I am attempting to backport some code written with Entity Framework Core to Entity Framework 6. I've encountered an issue where EF Core can successfully instantiate a complex DTO (i.e. an object with ...
RotundChinchilla's user avatar
1 vote
1 answer
117 views

I am trying to use the InsertFromQuery() to add data to a SQL table: ...
Ginto's user avatar
  • 41
0 votes
1 answer
161 views

I have the following query being generated by EF: ...
TheIronCheek's user avatar
  • 1,241
1 vote
0 answers
78 views

After updating our Dotnet API from dotnet 6 to 8 the connection-attemps on AWS RDS increased significantly (see attached picture). The API is running in a docker-container. We use a MYSQL RDS instance ...
jonny's user avatar
  • 34
1 vote
1 answer
93 views

I am reading the book C#12 In a Nutshell. The author says: Loading navigation properties When EF Core populates an entity, it does not (by default) populate its navigation properties: ...
FluidMechanics Potential Flows's user avatar
6 votes
1 answer
223 views

We are planning to use a Gitflow workflow and a shared test database. We currently use EF 6.5.1 and have automatic migrations disabled. Problem: if a developer runs ...
EMN's user avatar
  • 163
1 vote
2 answers
146 views

I am trying to populate a object with additional data from another object with Entity Framework from our data tables. ...
d_88_l's user avatar
  • 67
2 votes
0 answers
412 views

I am creating a brand new project to prototype an ASP.NET Core 9 Web API backend with PostgreSQL using the latest Entity Framework Core 9 and Npsgsql 9. Everything was going well until I hit a table ...
Trant's user avatar
  • 3,661
0 votes
0 answers
62 views

I'm trying to create my own filter for a specific type of data in hotchocolate. I created a class from FilterInputType<MyType> and specified an additional ...
loloskc's user avatar
0 votes
1 answer
103 views

I have a TaskFlowTemplate, pretty standard but a bit complex. Our users will have the ability to work locally in memory without need to save after every changes. My ...
Tobias Gustafsson's user avatar
0 votes
0 answers
71 views

I have been messing with this for days now and I'm at a loss. I keep getting The instance of entity type 'LineItemHeader' cannot be tracked because another instance with the key value '{id:1}' is ...
Matt Larson's user avatar
0 votes
1 answer
111 views

I'm using Hilo with a custom sequence name. When creating migrations, EF Core always creates a migration to drop the sequence with the normal name. Since EF Core 9.0, this produces a runtime exception ...
Merijn's user avatar
  • 751
1 vote
0 answers
200 views

I am running PG 17.5 Windows using the EDB community distribution. I am using Entity Framework ORM with Devart's dotConnect for PostgreSQL. The issue I am about to describe did not occur under PG 13....
sevzas's user avatar
  • 841
2 votes
2 answers
128 views

I have situation like this: I have two Blazor components, both using dbContext and I get popular error A second operation was started on this context instance ...
Vlado Pandžić's user avatar
3 votes
1 answer
113 views

I am running the following command to scaffold C# models of an existing database: ...
Red Puffle's user avatar
0 votes
1 answer
127 views

I want to implement "soft delete" in my application, meaning that instead of physically removing records from the database, I set an IsDeleted flag to ...
Tetik's user avatar
  • 1
-2 votes
1 answer
107 views

enter image description here My task is to get a photo from the stream and then save it to local storage and pass the path to this photo to the ViewModel, and then save the path in the database. I put ...
Артур Дементьев's user avatar
1 vote
1 answer
77 views

I have a web application: ...
JustAnotherCoder894's user avatar
1 vote
1 answer
109 views

I'm designing a .NET Core application using EF Core with a MySQL database, following a Table-per-Type (TPT) inheritance strategy. I have a base Report class with several derived types such as ...
Kafkaa's user avatar
  • 89
-2 votes
1 answer
104 views

I have a C# (C# 7.5) application that is using EF6. I have a table that contains two foreign keys. Both are one:one relationships and both are required. When I load a record from the database, the ...
AndyW's user avatar
  • 523
0 votes
1 answer
341 views

I'm trying to build a .NET 9 project using Visual Studio, and I keep getting the following error: Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1064: The Microsoft....
urtopcuoglu's user avatar
0 votes
0 answers
202 views

Im using EF Core in a .NET 9.0 Web API project, and I was trying to implement automatic migrations on API startup. The current project makes use of Docker containers (Configured using a Docker compose ...
thezuliano's user avatar
0 votes
1 answer
130 views

This is my table: user_id last_activity_time 1 2025-06-20 11:00:01 2 2025-06-20 11:00:02 3 2025-06-20 11:00:03 4 2025-06-20 11:00:04 Let's say, my input parameter if a user id list: ...
dafie's user avatar
  • 1,189
1 vote
1 answer
138 views

I'm working on a project that uses the legacy .NET Framework 4.x. I'm using LINQ here, but it's not behaving as I expected, and I'm not sure what mistakes I've made. I have the following MySQL table: <...
Tommas Lees's user avatar
1 vote
1 answer
90 views

I have grouped orders from the orders table so an order can have one or more purchases of a product with in an order. The problem is that when I purchase a single product that order with one product ...
redoc01's user avatar
  • 2,557
1 vote
3 answers
120 views

This post is translated Ko to Eng. I understood that using .Include() in Entity Framework triggers eager loading, and that when ...
RKO's user avatar
  • 13
1 vote
1 answer
82 views

A rather complicated object mapping I've inherited uses static Expression<Func<...>> in the .Select call (from my ...
C Howell's user avatar
0 votes
1 answer
169 views

I'm encountering an issue when executing transactions on system-versioned tables (SQL Azure) in my ASPNET Core + Entity Framework app. In my database, there are two system-versioned tables: dbo....
ilMattion's user avatar
  • 2,019
0 votes
2 answers
96 views

How can I convert an EntityQueryable to an IIncludableQueryable? I get this error... Object of type 'Microsoft....
Matt's user avatar
  • 7,015
2 votes
1 answer
52 views

I am attempting to create a method that filters data based on what the user types into my search bar. What to want to do is filter based on the name of a suspect. "Suspects" being a child ...
kylecol's user avatar
  • 55
1 vote
1 answer
190 views

My use case is that I want to retrieve a large number of records from the database and write them to a file stream, e.g. a .csv file. To reduce memory pressure I ...
NickL's user avatar
  • 1,980
0 votes
0 answers
70 views

I am working on a Blazor Web App using SQL as my database. My initial database migration works fine. However, when I make a change to one of the model classes, even a simple change, and try and add a ...
physics90's user avatar
  • 963
1 vote
0 answers
80 views

I have the following 2 tables defined in the DB (follows) with fixed schema, meaning I am not allowed to change it. Some details were omitted for readability: ...
Radek Strugalski's user avatar
0 votes
1 answer
25 views

I'm trying to run the EF Core Northwind tests for our EF Core implementation and the calls to AssertSql (which call AssertBaseline()) fail as below. This is with .NET 8, Xunit 2.9.3, in Rider, on ...
mn_test347's user avatar
0 votes
1 answer
63 views

I have a page that lists a bunch of doctors with their specialties, and a drop down list of specialties above it. When you initially open the page, it shows all doctors below the drop down list. I ...
bradd's user avatar
  • 3
0 votes
1 answer
88 views

I have an await _context statement that returns a single value from a table (StatusDesc). This ...
socker_dad's user avatar
1 vote
1 answer
138 views

I have methods used in IQueryable.Select(...) that shares the same logic of mapping an Entity class to a DTO class, but filter the navigation properties in the ...
SyndRain's user avatar
  • 4,017
0 votes
1 answer
145 views

Currently migrating to using Microsoft.Data.Sqlclient within our app that uses Ef6. We are on Ef 6.5.1 and using the Microsoft.EntityFramework.SqlServer package. When attempting to run a query with ...
cvb's user avatar
  • 791
0 votes
1 answer
61 views

I'm working on an EF project. This is my entity: ...
MICHELE TROTTA's user avatar
0 votes
0 answers
196 views

I'm building a .NET Aspire-based application using PostgreSQL with Entity Framework Core. I’m registering my DbContext like this as I am using ...
geothachankary's user avatar
0 votes
1 answer
79 views

I have a query that I want to return an entity with a filtered collection navigation property. According to the EF6 document I should be able to load it via explicit loading. However, after the ...
SyndRain's user avatar
  • 4,017
0 votes
0 answers
15 views

I am not seeing an answer to configuring what I need out there on the interwebs and here. Imagine I am working on a pricebook app (for fun). One part of my data model is ...
user2919960's user avatar
0 votes
2 answers
151 views

Running NbLinksExpirationStatus takes about 12 seconds to execute, which is not fast enough for what i am trying to achieve. Could it be Contains() problem and is there any way i can make it execute ...
mnol's user avatar
  • 33

1
2 3 4 5
1837