[FEATURE] DB Context Factory / EFCore 6 Change Tracking challenges
See original GitHub issueIs your feature request related to a problem? Please describe.
As context, I’ve always been a fan of accessing and creating dbcontexts when I’ve needed to do multiple db related actions. I feel with this project I should give in and simply adopt the context factory method but no idea how I’d go about doing that.
Problem I’m running into is I’ve added an ICollection<Hero> Heroes to the user class but when trying to create it, I continuously getting change tracking problems.
Describe the solution you’d like
Add ICollection<Hero> Heroes to the User class and adopt (if it’s the right solution) a db context factory
Describe alternatives you’ve considered I did wonder about scoped vs transient but I feel the context factory might fit better
Additional context None
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12 (4 by maintainers)

Top Related StackOverflow Question
So it’s probably my lack of dotnet aspnet knowledge but I think what I’m going to do moving forward is use the repository if I’m interacting with the database entities in any way and then the service to map the entity to a Dto to transfer to the client,
Forgot to say, also love the boilerplate!