In my application I have a basic architecture as shown:
RepositoryMethods (DO) --> BusinessEngines (DTO) --> Controller (ViewModel)
I like to keep all the Entity Framework / DbContext access code in one place. My Repository methods all have the DbContext injected and are all API style as opposed to a generic repository:
Task<Post> GetAllPostsInCategory(int categoryId);
So as the entities (Domain Objects) are converted to Data Transfer Objects and then to View Models, can entity framework still track them or should I always be using .AsNoTracking()
in every Repository method? In dot net core I think this can be set globally am I correct?