Skip to main content

Questions tagged [entity-framework]

An ORM built by Microsoft and is available as part of .Net framework 3.5 and later.

8 votes
4 answers
2k views

When using Entity Framework and running the Update-Database command, non-updated applications that rely on the database crash due to database context changes. Usually teams have a production database ...
EMN's user avatar
  • 795
1 vote
1 answer
321 views

public void ReassignLineItems(InvoiceUpdateDto invoiceUpdate) { Invoice invoiceInRepository = _unitOfWork.InvoiceRepository .FirstOrDefault(invoice => invoice.Id == invoiceUpdate.Id); ...
EMN's user avatar
  • 795
2 votes
2 answers
162 views

I'm facing a tricky situation that might result from a not thoroughly thought-out design, and I'm hoping to understand whether a deadlock might be a realistic cause – and if so, how to prevent similar ...
ComfortableOnion's user avatar
1 vote
3 answers
190 views

I am developing some modular libraries that contain common APIs, data, and functionality. One of the core assumptions to these libraries is you would use which you want to compose your project, but ...
SventoryMang's user avatar
0 votes
1 answer
377 views

Actually, in a Web API application using Entity Core, it seems very common to inject the application context to the controllers, so the controllers use directly the dbContext to do its work. Something ...
Álvaro García's user avatar
0 votes
1 answer
317 views

I am trying to apply Robert Martin's Clean Architecture on my .NET project. In one of chapters about boundary, it talks about that database interface should reside in business logic component rather ...
Afshar's user avatar
  • 223
1 vote
3 answers
829 views

This is something that I've heard a number of opinions and theories about, but I'm still torn on how to go forward. For context, this particular issue deals with the following technologies, in case ...
CrystalBlue's user avatar
3 votes
4 answers
897 views

Are the reasons for why Microsoft states that DB contexts should not be long lived because of measurable effects (memory leak, resource hog, increased probability of data corruption, ...) or is it ...
Mandelbrotter's user avatar
0 votes
2 answers
121 views

I have in project linq repository unit tests. [Fact] public async Task Get_FromTreeEntitiesUnsorted_RetunsOrderByDescending() { //Arrange _contextReadonly.Entity.Add(new ...
cargt4's user avatar
  • 19
0 votes
2 answers
699 views

I am told everywhere that entities are only to represent the data structure, then entities should be mapped to a model and then the model possibly to a DTO. The other way is similar, DTO -> model -&...
Gersalom's user avatar
0 votes
0 answers
52 views

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 ...
Samuel's user avatar
  • 799
0 votes
2 answers
345 views

I am currently working on implementing the Clean Architecture pattern using Entity Framework. However, I've encountered an issue related to the design of my Domain project. In this project, I need to ...
pakerinjo's user avatar
-1 votes
3 answers
2k views

My Domain layer contains below model: public class ApiResource { public bool Enabled { get; set; } = true; public string Name { get; set; } public string ClientId { get; set; } public ...
Szyszka947's user avatar
1 vote
3 answers
2k views

We have a very messy data repository component, with dozens of methods to interface a DbContext (entire database) in Entity Framework. It was (and is) coded in a way that adds a new repo method for ...
Veverke's user avatar
  • 541
1 vote
2 answers
225 views

I have a Product entity: public class Product { public int Id { get; set; } public string? Name { get; set; } public string? Description { get; set; } [ForeignKey("Brand"...
Subliminal Hash's user avatar

15 30 50 per page
1
2 3 4 5
26