Questions tagged [entity-framework-core]
For questions about Entity Framework Core (EF Core) for .NET Core. Please also add a version-specific [ef-core-xx] tag, when applicable. Note that Entity Framework for .NET Framework is an older, different product that fits the [entity-framework] tag.
entity-framework-core
22,776
questions
0
votes
0
answers
16
views
Dynamically create Entity,DbSet,Migration file,Migrator file and Tables
I want to dynamically generate the following components based on user input properties:
Entity Class: Create a C# class representing the entity with properties based on user input.
DbSet: Add a DbSet ...
0
votes
0
answers
30
views
DbContext Identity login exception
I have a problem that I do not really know how to solve. So, here it is:
Image of exception
InvalidOperationException: Cannot create a DbSet for 'IdentityUserClaim' because this type is not included ...
1
vote
0
answers
30
views
How to calculate Running balance in RDLC reports?
I have an application that uses C#, Entity framework core & MySql database for tracking income & expense and i'm using RDLC for reporting.
I have a transactions table for tracking income and ...
0
votes
0
answers
24
views
create migrations in an unit test project
I have an ASP.NET Core Web API project with EF Core and a SQL Server database using the repository pattern. All works fine.
I added to the solution an xUnit test project and referenced the Web API ...
0
votes
1
answer
26
views
The x field is required error in EF Core requests
If got a controller endpoint expecting a DTO with just a list of Ids to fetch this specific list of IDs. When sending the following request to the endpoint, it returns an error
the idList field is ...
1
vote
0
answers
31
views
Can't use Entity Framework Core with Supabase (PostgresSQL)
I was trying to move my project from local to remote database.
I've created an ASP.NET Core 7 Web API project. I've installed Microsoft.EntityFrameworkCore 7.0.20, Microsoft.EntityFrameworkCore.Design ...
0
votes
0
answers
28
views
Using EF Core ChangeTracker for Blazor Web App (Serverside)
I have a webshop running in a Blazor Web App application (server side). Everything works perfectly locally. But as soon as the application is online, it crashes every few days. This means that when I ...
1
vote
1
answer
65
views
How to do an inner join?
I have an ASP.NET Core project where I am using Entity Framework to manage database queries. I want to know how I can do an INNER JOIN between two tables with Entity Framework, in this case the user ...
0
votes
1
answer
33
views
EF Core: what exactly is the command timeout measured on?
I was previously downloading via EF millions of records without encountering any timeouts, however, after adding a WHERE clause to limit the download to only a few thousand records, I am frequently ...
-1
votes
1
answer
23
views
Entity Framework Core: using non-anonymous type for outer/inner key selector
I have many "join" tables in my data model, implementing many-to-many relationships, and these are having composite primary keys, one for each side of the relationship. I have for example ...
0
votes
0
answers
16
views
EF Core How to select multiple rows using more than 1 specific value for each row
I have a table with columns SchoolId, SchoolYearId, and ItemId with a unique constraint across all 3. This table is fully mapped in EF Core 6. On the C# side I have a list of tuples, where each tuple ...
0
votes
0
answers
22
views
Adding an interherited class from a different assembly by using a discriminator, and then retrieve it
I'm facing the following situation: I'm creating an agenda with a AgendaItemModel that is created in a assembly called AgendaModule. You can assume this assembly is being used, but there is another ...
0
votes
0
answers
28
views
Filtering by time zone in postgres sql using EF Core
I'm developing an app using ASP.NET Core 8 and EF Core 8.
I have installed the package Npgsql.EntityFrameworkCore.PostgreSQL Version=8.0.2.
I have a scenario where I need to filter an entity by date ...
0
votes
0
answers
39
views
Multiple JOINs is extremely slow on SQLite
I'm using EF Core with SQLite. For the MCVE, let's say, I only have these tables [DomesticContainers, DomesticRecords, InternationalContainers, InternationalRecords, Clients], where there's a one-to-...
0
votes
1
answer
37
views
EntityFrameworkCore - Can we create an Entity From a creation request class?
Let's say I have this class
public class Person {
public required Guid Id { get; set;}
public required string Name { get; set; }
// ...
}
I like the required keyword so at a compiler ...