All Questions
Tagged with c# entity-framework-core
14,469
questions
0
votes
1
answer
20
views
.NET Integration Test Singleton Service instantiated twice
I am working on a .NET SQL Server based application for which I need to write Integration tests.
I am using CustomWebApplicationFactory to overide DbContextFactory to use an in-memory SQLite DB in ...
-1
votes
1
answer
19
views
Entity Framework Core : Select() - change a column name
I have the following select:
var allUsers = await dbContext.AppUsers
.Where(u => allUserIds.Contains(u.IdentityUsersId))
.Include(u => u.Following)
.Select(u => new
{
...
-3
votes
1
answer
26
views
Entity Framework Core : Select() - turn an IList<> property into a joined string?
I have the following select which returns the 4 columns I want:
var allUsers = await dbContext.AppUsers
.Where(u => allUserIds.Contains(u.IdentityUsersId))
.Include(u => u.Following)
...
0
votes
0
answers
13
views
Entity Framework Core 8.0.7 DB-first Scaffold-DbContext database with custom namespace
I'm using EF Core 8.0.7 and a database-first approach.
When I'm running Scaffold-DbContext on the database with the command shown here, I'm getting semicolon after namespace and class is not any name ...
0
votes
0
answers
9
views
How to add new column to existing abp table __core_EntityPropertyChange
I am using abp(aspnet boilerplate) framework. There is framework build table __core_EntityPropertyChange for auditing purpose.
Since this is framework build table so I am unable to add new column to ...
-3
votes
0
answers
24
views
Asking for help converting SQL query to EF Core [closed]
I have a working program that uses SQL queries to collect data. I'm working on converting it to EF Core 8.
I found an online convert but the result will not compile in my C# project. Can someone ...
0
votes
0
answers
20
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
34
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
32
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 ...
2
votes
0
answers
34
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
29
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 ...
-1
votes
1
answer
24
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
17
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 ...