Questions tagged [efcore]
The efcore tag has no usage guidance.
24
questions
1
vote
2
answers
255
views
Migration pattern for logic too complex to cover it with SQL
When you create migration in EF Core you can spice it up with arbitrary SQL query. Yet there is a limit to it -- maybe the migration is too complex in technical sense (i.e the SQL cannot handle it) or ...
0
votes
0
answers
43
views
Designing an optimization on throughput of EF.Core application
I am looking for feedback on a design problem I encountered when processing batches of db entries. The issue at hand is efficiency and throughput of an application.
The application looks like this ...
0
votes
0
answers
143
views
How to design entities to keep up with the depth of JSON objects?
To better context see Rich Authorization Requests for OAuth2
As u can read here there are some common data field types like actions, locations etc.
So I have created C# entity for EF as below:
public ...
0
votes
0
answers
201
views
Avoiding reloading entities many times with EF Core and Mediatr
We have a largeish .NET Core project which uses Mediatr and EF Core. Many of the queries look something like:
public class GetSomeInformation : IRequest<string>
{
public int DocumentId { get;...
0
votes
1
answer
266
views
DDD+CQRS - Should I always check if the Databases are online?
I'm developing an intranet application and I'm trying to use some concepts from Domain Driven Design (DDD) and Command and Query Responsibility Segregation (CQRS) in .NET Core, with EFCore.
But, to ...
0
votes
2
answers
663
views
Structure database for timeline with different objects
I need to work on a project where we have a "case". Within this case we need to attach different things, in a timeline.
Those things can be:
Status change (Open, On hold, Closed)
Messages (...
3
votes
1
answer
841
views
CRUD is too simplistic for my usecases, how would you handle the repository pattern when using MediatR and EF Core?
I have a .Net 5 Web API project and use MediatR to encapsulate my business logic into commands and queries since I don't like to have a single CRUD service handling everything related to a specific ...
0
votes
1
answer
277
views
Should I decouple domain models from IIdentity in ASP.NET core?
I saw a lot of examples of decoupling domain models from Identity models. For my knowledge, currently IIdentity is included in standard .NET library, so is this actual now and should I follow this ...
1
vote
1
answer
745
views
DbContext lifetime in desktop app with SQLite
I am creating a small data-driven desktop application using .NET 5 with WPF, ReactiveUI, Dynamic Data, and EF Core 5. The app uses a local SQLite database to store all persisted state, and relies ...
3
votes
5
answers
497
views
How should I work around a particular "chicken and egg" problem with entity construction?
I'm struggling to think of a concise way to phrase the question, but assume you were developing an application that managed employees at various company branches. You could potentially model this part ...
1
vote
2
answers
837
views
Is it acceptable to pass a "context object" through a pipeline of entities?
Overview
Domain-driven design prescribes modelling a particular domain with classes that contain both state and behaviour. Microsoft attempt to support this methodology in modern C# applications ...
1
vote
0
answers
374
views
Should I use a Web API between a client and Entity Framework?
I am creating a database that will keep track of my company's clients, and an app that will allow users inside the company to read/update/etc. the database. I'm using code-first EF Core to manage the ...
5
votes
2
answers
625
views
DDD Domain Modeling of Transportation Module
I am in the process of trying to model a transportation module for an ERP type system using C# and EF Core. This service is responsible for managing customer pickups and company-owned truck ...
4
votes
2
answers
5k
views
Are in-memory database a form of integration tests?
I have looked through most of the answers given regarding using in-memory database for unit test, but I could not find one that was clear to me.
I am writing some unit tests to cover some of our ...
0
votes
2
answers
2k
views
Call API endpoint from API itself
I'm creating an .NET Core 3 API with Entity Framework. The data is from an existing database.
Now I've the following situation:
/persons -- get all the persons
/companies -- get all the companies
/...
1
vote
2
answers
798
views
Is there still a place for non-async methods in Data Repository?
If we start a .NET Core 3.0 project today, which will use database connection (for example ASP.NET Core Web API), is there still a place for non-async operations while talking to the database?
Or in ...
4
votes
2
answers
463
views
Robust architecture with EF Core
I'm trying to figure out how it's possible to robustly code against EF Core in a large, multi-tiered codebase. We have been experiencing several issues, and most of the example project architectures ...
8
votes
4
answers
8k
views
Clean Architecture - Where to put business calculations when entities are autogenerated db first efcore?
I'm trying to switch to clean architecture from a traditional layered architecture approach and trying to figure out where to put business logic. Please consider the below scenario -
Employee class (...
1
vote
1
answer
867
views
Data entities in Onion Architecture
I'm trying to build a project using onion architecture (just a "Northwind"ish type app to get more up to speed with .NET Core). I also want to get a better grasp on Onion Architecture principals. I ...
1
vote
0
answers
964
views
EF Core Many to Many Relationship
I am thinking about using Entity Framework Core in a new project. The project has a many to many relationship. Entity framework Core does not allow shadow state entities as described here: https://...
0
votes
3
answers
2k
views
How to handle a many to many relationship with an ORM mapped to a Domain Model when there are no technical constraints?
Domain Driven Design states that you should have a domain model, which reflects the ubiquitious language used by the domain experts. When using ORMs and many to many relationships I am use to doing ...
4
votes
3
answers
2k
views
Should I merge database migrations together before release?
During the development process many migrations may appear. Is there any point to keep them instead of merging them all together?
Let's take a look into a simple example.
During development we ...
3
votes
1
answer
1k
views
Best practices for translatable models in Entity Framework Core 2.1+
I'm building an Entity Framework Core-backed ASP.NET Core RESTful service and I have entities / models such as Product, Document etc with description in multiple languages.
I want to be able to ...
0
votes
0
answers
615
views
WPF DI with DbContext per form
Trying to figure out how to keep class methods clean, follow EF's guidance of short-lived DbContexts, and use DI in WPF. Issue I'm having is implementing transactions with DI. I'm trying to figure ...