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.

0 votes
1 answer
250 views

Is IRepository allowed to know about database entities?

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
155 views

Creating Unit and Integration Tests with Database elements

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
362 views

In EF why should a DB contexts not persist?

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
84 views

EFCore In Memory repository Unit Test of Encrypted data

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
295 views

Should entities always be simple and mapped?

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

Domain Project and Identity Project circular dependency

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

How to properly design database in accordance with DDD

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
1k views

Using Repository Pattern with .NET Entity Framework with a single Get method with optional parameters for each table include

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
  • 461
1 vote
2 answers
145 views

Designing Products with multiple variations

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
1 vote
1 answer
2k views

Mapping between Entity and ViewModel

I'm trying to make an application in ASP.NET MVC. I'm using AutoMapper for the conversion between entities and ViewModels. In most cases, this works fine, but when I need to add some additional data (...
Sam's user avatar
  • 65
0 votes
1 answer
2k views

Doubt about DDD, entity core and backing field

I was reading the documentation about how to use Entity Core in a DDD way. This is the documentation. It is said that I can configure EF to can map an internal private field to a private field, the ...
Álvaro García's user avatar
-1 votes
1 answer
619 views

REST API designing resources for complex entities

I have an ASP.Net Core Web API where I am having difficulties designing the REST resources based on the EF Entities I have. There are three entities that describe a Reservation. First, there is the ...
J.Paravicini's user avatar
2 votes
2 answers
1k views

Why should I use an ORM like Entity Framework Core?

I have taken over the maintenance and development of a mature .NET Framework ASP.NET MVC application which uses an Entity Framework repository pattern. Several developers have worked on it before me ...
Ian's user avatar
  • 131
2 votes
2 answers
2k views

Where should helper classes/methods for transforming business data for the View be located

I have inherited a badly architected and organised ASP.NET MVC application, which is an online booking system for healthcare providers. It seems to have been designed with very few object oriented ...
Kyohei Kaneko's user avatar

15 30 50 per page
1
2 3 4 5
26