Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged entity-framework-core

1 child tag

For questions dealing with the .NET Core version of Entity Framework, an ORM developed by Microsoft.

This tag doesn't have a detailed wiki yet.

66%
+2 −0
Q&A CS8032 analyzer warnings in empty EF Core project in Rider

I'm evaluating JetBrains Rider 2023.3 on Linux and almost immediately ran into a compiler warning that I don't understand. Attempting to isolate it, I created a new solution containing a .NET 6 cla...

1 answer  ·  posted 4mo ago by Kevin Krumwiede‭  ·  last activity 4mo ago by Kevin Krumwiede‭

60%
+1 −0
Q&A EF-core Find method doesn't include other entities

(Full code available for cloning here) I've run into some odd behavior of EF-core's Find method. It seems like the returned entity doesn't include the rest of the data. MWE Models using Micro...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 10mo ago by Sylvester‭

71%
+3 −0
Q&A Updating the database reverses previous changes

The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...

2 answers  ·  posted 1y ago by Moshi‭  ·  last activity 12mo ago by FoggyFinder‭

60%
+1 −0
Q&A How to refer to the same class twice from one Entity Framework entity?

I have two classes, Contestant and Picture, with the following setup: public class Contestant { ... public int AvatarID { get; set; } [ForeignKey(nameof(AvatarID))] public ...

1 answer  ·  posted 1y ago by FrankLuke‭  ·  edited 1y ago by Alexei‭

66%
+2 −0
Q&A Order a subcollection from linq

I am using linq/EF core to retrieve data via an API call. How do I sort the collection of related data for each retrieved entity? Assume the following structure: an Order is made on a certain da...

1 answer  ·  posted 2y ago by mcalex‭  ·  last activity 2y ago by Alexei‭

66%
+2 −0
Q&A C# WPF datagrid not persisting inserts

I am working with VS 2022 and trying to make a WPF MVVM application. The application updates the items displayed in the datagrid, persisting the changes to the database upon save. However, adding a...

0 answers  ·  posted 2y ago by FrankLuke‭

66%
+2 −0
Q&A Mixing "operational" database models with archiving ones in the database context

Context Our product owner has realized that some entities are duplicated from time to time and that a merge is required. This should clean up existing duplicates and also allow special users to me...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by meriton‭

72%
+6 −1
Q&A How to separate DB query logic from the application other than implementing a repository on top of an ORM?

I've been doing a lot of reading on implementing the repository pattern in C# projects and found controversy, or shall I say some strong criticism, made by seemingly very smart people with previous...

1 answer  ·  posted 3y ago by Marc.2377‭  ·  last activity 3y ago by Alexei‭

71%
+3 −0
Q&A What are the factors to consider when deciding to split ORM queries or use eager loading?

I have extensive working experience with Entity Framework ORM and have noticed two major ways of writing LINQ (LINQ2SQL): lot of eager loading: the most prevalent, uses (lots) of Includes to eag...

0 answers  ·  posted 3y ago by Alexei‭

71%
+3 −0
Q&A How to manage views and stored procedures in an ASP.NET Core project?

I am slowly modernizing an older ASP.NET Core Web API and one of the steps involved migrating from database first to code first. Now, all schema changes and seeding is covered by migrations which ...

0 answers  ·  posted 3y ago by Alexei‭

66%
+2 −0
Q&A What are the cons of directly mocking Entity Framework DbSets instead of working with an in-memory database when unit testing the application?

I have recently contributed to a Clean Code project and had a discussion about how to implement unit tests. The project author argues for using an in-memory database (which easily replaces the rea...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Goyo‭

60%
+1 −0
Code Reviews Are any downsides of hiding the actual Entity Framework Core DbSets and exposing only some generic methods?

I have recently started a project based on the clean architecture principle and noticed that it did not rely on generic repositories since Entity Framework's DbSets are doing the job just fine. In ...

0 answers  ·  posted 3y ago by Alexei‭

66%
+2 −0
Q&A How to automatically run Entity Framework Core migrations for an application which uses a user with read/write rights on certain tables?

I have decided to convert a legacy database-first ASP.NET Core project to code-first. However, I have noticed that the project used the same database as another bigger project and the Entity Framew...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Alexei‭

60%
+1 −0
Q&A What is the rationale of having Cascade as a DeleteAction in EntityFramework.Core?

I have noticed some time ago that Entity Framework assumes a CASCADE behaviour (implicit value, if not specified) for referential constraints (FKs) when deleting items. This means that by default, ...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Alexei‭