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 because of a more subjective reasons (anti pattern, hard to manage multiple instances of the same record, increased complexity in multi threaded applications, …).
How to ThenInclude all in a hierarchy?
I have an object called a Market which may have 0-many other submarkets, which all use the Market object and are stored in the same table as their parent.
How to make the orderby dynamic with the model data
var baseQuery = _dbContext.tablename.AsQueryable(); var AllSales = await ( from obj in baseQuery select new model() { column1= obj.column1, column1= obj.column1, } ).OrderBy().Skip(model.Start).Take(model.Length).ToListAsync(); I tried to add orderbydynamic function in place of orderby but it says this IQueryable does not contain the definition of orderbydynamic i want to add order by within model columns please…
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.
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 -> entity.
Is a repository return a graph of entities violating SRP?
I’m working in this scenario