Skip to main content

All Questions

0 votes
2 answers
68 views

Two DbContext for two separate databases in same infrastructure project (all in the same namespace if that matters). All entities are in same domain project (entities for each database are in their ...
Rick's user avatar
  • 1,915
Tooling
0 votes
4 replies
90 views

My employer is making us use ef core 10 and I have problem migrating data because the pomelo nuget package that seem to be out and available is v 9 when will the version that's compatible with ef core ...
Raul Usmov's user avatar
1 vote
1 answer
85 views

I'm storing JSON data in SQL Server 2022 in a varbinary(max) column. I'm aware that SQL Server 2025 offers a proper JSON data type, but I'm working with SQL Server 2022 for now. I'm using EF Core to ...
0xced's user avatar
  • 27k
Best practices
1 vote
5 replies
97 views

I want to write integration tests that verify my ASP.NET Core endpoints don't produce N+1 queries. Specifically, I want a test to fail if an endpoint that should execute 1 query suddenly starts ...
Kiwi's user avatar
  • 31
Best practices
0 votes
2 replies
63 views

The official docs say to install MiniProfiler.EntityFrameworkCore and then public void ConfigureServices(IServiceCollection services) { services.AddMiniProfiler() .AddEntityFramework()...
UserControl's user avatar
  • 15.3k
1 vote
1 answer
106 views

I have a list of objects with some, but not all, properties filled in from the database: class Example { public int Id { get; set; } public int A { get; set; } public int B { get; set; } ...
AAM111's user avatar
  • 1,291
0 votes
1 answer
66 views

I have a lookup item and a parent entity that I want to add in the same transaction. So for instance, I use this code: foreach (ParentDto parentdto in ParentList) { Parent newParent = new Parent();...
coolblue2000's user avatar
  • 5,186
0 votes
1 answer
101 views

I am trying to write a query like the following with a similar model. I think I understand the problem, but have not been able to edit the model in a way that doesn't add new foreign key columns to ...
anthonymp13's user avatar
2 votes
1 answer
53 views

I have an Events base class with an abstract child class which itself has two (for now) child classes: public class Event { } public abstract class FooEvent : Event { public Foo? Foo { get; set; }...
minnmass's user avatar
  • 261
1 vote
1 answer
64 views

I'm trying to map some enums in my model to PostgreSQL custom enum types using EF Core, but no matter what I do, EF Core keeps sending the values as integers instead of using the PostgreSQL enum type. ...
Henrique Miranda's user avatar
0 votes
1 answer
79 views

I use MongoDB.EntityFrameworkCore. I have 3 classes: Pod, Planet, Asteroid with inheritance from SpaceObject I want use the default Table-Per-Hierarchy (TPH) mapping for Planet and Asteroid to save ...
Troopers's user avatar
  • 5,494
1 vote
1 answer
127 views

My ASP.NET Core app is throwing this exception, and I can't figure out how to resolve it: An error was generated for warning 'Microsoft.EntityFrameworkCore.Migrations.PendingModelChangesWarning': The ...
Grant Birchmeier's user avatar
-1 votes
1 answer
139 views

I'm trying to populate an object with two collections of type ChatSession. ChatSession contains two types of sessions, Open and Solved. Edit: Query changed to fit solution from Charlieface. Add<...
SteinTech's user avatar
  • 4,149
2 votes
1 answer
101 views

I have an ASP.NET Core 9 Web API and database in SQL Server. I'm trying to run them in containers, and have the API connect to the database. I have been developing this locally for a while and ...
MRichards's user avatar
  • 173
0 votes
1 answer
51 views

I'm using .NET 8 with NSubstitute for unit tests. Even though I setup my repository using IQueryable and BuildMock correctly: when calling ToListAsync, unit test is working fine when calling ...
heringer's user avatar
  • 3,317

15 30 50 per page
1
2 3 4 5
1570