Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

I'm using .NET 9. I have a query running at night. It runs in a separate thread depending on the CPU count. If there are 4 physical CPU, it will spawn 4 threads and run concurrently. I have ensured ...
s k's user avatar
  • 5,376
0 votes
1 answer
57 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,176
0 votes
1 answer
146 views

I have a method, that returns a value of type List<IGrouping<PGGroupingKey, PGroupingResult>>. The request code and description of the types are below internal class PDGrouppingKey { ...
Denis Nozdrin SullenMan's user avatar
1 vote
1 answer
84 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
51 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
53 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
78 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
111 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
137 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
46 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
50 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
0 votes
1 answer
76 views

I'm trying to use Directus as a read-only admin UI for an existing PostgreSQL database where all tables are created and managed by EF Core (.NET) migrations. I want Directus to only handle UI ...
Вячеслав's user avatar
3 votes
0 answers
57 views

I am hitting a wall combining HotChocolate's projection engine (ISelection) with Entity Framework Core when trying to project database entities into custom view models / DTOs. Whenever I append ...
Tewis's user avatar
  • 31
4 votes
2 answers
154 views

I’m implementing an atomic append operation on a jsonb array column in PostgreSQL and want to understand the concurrency behavior of UPDATE ... RETURNING. My table has: "Thumbnails" jsonb ...
Muhammed Furkan Güler's user avatar
3 votes
1 answer
132 views

I have an ASP.NET Core 10 application using EF Core 10 with SQL Server 2017. Problem: Queries work normally when the app starts. After the app is idle for a few minutes, all EF Core queries become ...
Ahmet Poyraz Akçal's user avatar
2 votes
2 answers
112 views

We are using .NET 10 and the following NuGet packages: Microsoft.EntityFrameworkCore 10.0.3 Microsoft.EntityFrameworkCore.Design 10.0.3 Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0 We have a simple ...
Aleks Vujic's user avatar
  • 2,360
Best practices
4 votes
3 replies
124 views

I have a workflow I use with our development team that involves merging EF Core migrations in our C# project. Our team works in feature branches and often needs to create new EF Core migrations. They ...
Ryan's user avatar
  • 8,007
Best practices
1 vote
1 replies
95 views

I’m developing a web application for pharmacovigilance similar to VAERS and some UN health reporting dashboards. The app is built with .NET 8, Entity Framework Core, and MySQL.Users are medical ...
Jabel Resendiz's user avatar
Best practices
0 votes
2 replies
128 views

Can I use a database-first approach to generate models initially, then move to code-first later for easier updates? What's the best way to do this? If so, what is the recommended workflow, and what ...
Công Minh Nguyễn's user avatar
1 vote
0 answers
66 views

I am creating a REST API, and I am using EF Core 9. I have the database and the tables. I want to run database first to import the tables into the application. I ran this command: Scaffold-DbContext &...
Diego's user avatar
  • 2,412
Advice
1 vote
5 replies
112 views

We have a large scale application that was ported to .NET and contains a lot of legacy code in stored procedures. Mixing EF Core with stored procedures is causing troubles in some scenarios, due to ...
hrontos's user avatar
  • 41
5 votes
2 answers
194 views

I understand that the main purpose of EF Core is to let the developer work with a database without paying attention to all the specifics of database programing, and let him just work with plain .NET ...
hrontos's user avatar
  • 41
0 votes
0 answers
77 views

I have an ASP.NET Core 9 Web API project running with SQL Server. It has been developed so far locally, only with SQL Server running in Docker. I've decided to move the API project to Docker, ...
Ercüment Kalkan's user avatar
5 votes
0 answers
151 views

I have two model classes, Entity and EntityVersion (the name Entity here is unrelated to EF, it's just coincidence given my company's domain). Their (simplified) models have a few relationships: One ...
Kallum Tanton's user avatar
1 vote
0 answers
44 views

I am developing an ASP.NET Core Web API and have the following code in my Program.cs: // Apply migrations / create database on startup using (var scope = app.Services.CreateScope()) { var logger = ...
Benjamin S. Sorterup's user avatar
0 votes
0 answers
116 views

I am using the Bulk Update APIs, part of EF Core like the ExecuteUpdateAsync() functions, to perform updates, and I am passing in a lambda for my valueExpression. I am wondering if the evaluation of ...
bssskpbmb-629801's user avatar
Best practices
0 votes
3 replies
86 views

I have been building a concurrent system for a while. In the past I found some articles about "serializable" transactions. I have been using code first EF Core primarily for any database ...
Vladimir's user avatar
  • 398
0 votes
1 answer
110 views

After installing the .NET 10 SDK, I started getting an exception when trying to create migrations with Entity Framework Core. The command I'm using: dotnet ef migrations add MigrationName --startup-...
Ibray's user avatar
  • 41
1 vote
1 answer
92 views

I'm starting a new project with Blazor and authentication using .NET 10. I want to move my DbContext to a separate library. The DbContext has an additional parameter in its constructor: public class ...
Artur Michajluk's user avatar
1 vote
0 answers
183 views

I'm hoping to create a "common" DLL with common entities (i.e. Person, RMA, RMAFollowUp, etc) in that lib I code all the reference like RMAFollowUp entity may reference a Person and RMA but ...
doubleM's user avatar
  • 11
4 votes
1 answer
133 views

On EF Core (>= 8, I think), I can define an entity with an owned entity, along with a simple DbContext like this public class ObjectIn3DSpace { public int Id { get; set; } public string ...
Jon Gan's user avatar
  • 927
2 votes
1 answer
128 views

I want to use a json function of PostgreSQL, that is not part of NpgsqlJsonDbFunctionsExtensions [DbFunction("jsonb_extract_path_text", IsBuiltIn = true)] public static string JsonExtract(...
ZorgoZ's user avatar
  • 3,746
1 vote
0 answers
120 views

I use a peer-to-peer messaging system. Here is the class: public class MessagesModel { public long Id { get; set; } public ApplicationUser UserExp { get; set; } public ApplicationUser ...
AMP59's user avatar
  • 63
4 votes
1 answer
265 views

We just migrated from .NET 8 to .NET 10, and had several migrations fail because of pending changes. For most it was a matter of fixing the pending changes with new migrations, but for one project ...
The Lemon's user avatar
  • 1,557
0 votes
1 answer
62 views

I have a large database in a MIB. Developed using EF Core with a database-first (or schema-first) approach. When the system is fired up, it will first check the database version (a table in the ...
s k's user avatar
  • 5,376
Advice
0 votes
2 replies
104 views

When writing EF Core integration tests, I often see examples that remove the existing DbContext registration like this: public class CustomWebApplicationFactory : WebApplicationFactory<Program> {...
Wayfaring Tenno's user avatar
3 votes
1 answer
135 views

I have the following entity: public class CPU { public int Id { get; set; } public int Article { get; set; } public int Garanty { get; set; } public int ServiceLife { get; set; } ...
McLaren's user avatar
  • 67
0 votes
1 answer
181 views

Any Idea what I am making wrong or is this just a bug in the Library? I am using MySql.EntityFrameworkCore version 10.0.0-rc and am trying to execute the following query: var list = new List<string&...
Jester's user avatar
  • 3,441
-2 votes
1 answer
93 views

I am new to ASP.NET Core and C# development, I was following a tutorial that create a web applications and get this error: Unable to create a 'DbContext' of type 'AppDbContext'. The exception 'Unable ...
reham501's user avatar
  • 165
3 votes
1 answer
112 views

I'm writing a web application that should use EF Core to handle a SQL Server Express server database (the application is called RRDA). The solution is divided into 3 projects: RRDA.Web (the web ...
weirdgyn's user avatar
  • 1,078
Tooling
0 votes
2 replies
64 views

I'm building a C# program using EF Core that synchronizes data between a production and a test database. The program retrieves a list of table names from the database, and only those tables should be ...
RKO's user avatar
  • 13
2 votes
1 answer
153 views

I am encountering a duplicate key value violates unique constraint error in my ASP.NET Core application, and while I understand why it happens, I am unsure about the best practice to handle it using ...
amg63's user avatar
  • 45
3 votes
2 answers
255 views

Imagine the following classes (much simplified version of the real use case): public class Driver { public Int32 Id { get; set; } public String Name { get; set; } public String Country { ...
MythJuha's user avatar
Best practices
0 votes
2 replies
73 views

I have to implement a feature to Activate/ Deactivate employee from two Entities : UserProfile and UserStatus in Domain Layer of ABP Application. I want to know the field where I can implement the ...
bibashmanjusubedi's user avatar
4 votes
1 answer
321 views

I am currently trying to insert an entity into one of my tables using EF Core. The entity looks like this: public partial class Foo { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] ...
Juli Krajewski's user avatar
0 votes
0 answers
136 views

In appsettings.json { "ApplicationInsights": { // https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core "ConnectionString": "SECRET" }, &...
Richard Barraclough's user avatar
2 votes
3 answers
117 views

I have a Product model class like this: public class Product { public int Id { get; set; } public string Code { get; set; } public string Name { get; set; } public decimal CatalogPrice { ...
pepr's user avatar
  • 21.1k
1 vote
0 answers
54 views

I'm in the process of removing .NET Aspire from my application and whilst this has been a mostly painless process, I'm having no end of issues getting my DbContext working the way I think it's meant ...
Darc's user avatar
  • 923
1 vote
1 answer
85 views

Having product-attributes relation (one to many)... public class Product { public int Id {get; set; } public string Code { get; set; } public string Name { get; set; } public List<...
pepr's user avatar
  • 21.1k
Advice
1 vote
0 replies
60 views

What is recommended way using Microsoft.AspNetCore.OData to implement custom aggregate method? Using a CustomAggregateMethodAnnotation class will execute it in memory, how can I achieve execution of ...
levaniko asatiani's user avatar

1
2 3 4 5
471