You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello EF Development team.
I have a question about dependency injection.
Does EF looking for dependencies when materializing object from database in this manner ?
publicclassPerson{publicPerson(DataContextcontext){
....
}// or maybe like this[Dependency]publicDataContextContext{get;set;}}
After loading and materializing from database DataContext(DataContext is inherited from DbContext) must injected in constructor.
@bricelam@smitpatel This is actually about being able to inject services registered in the application D.I. container. We haven't implemented this yet.
Activity
Artur2 commentedon Oct 8, 2015
@bricelam , @rowanmiller ?
divega commentedon Oct 8, 2015
We currently don't support this, but it is one of the capabilities for flexible object mapping (#240) we will consider adding in the future.
Artur2 commentedon Oct 8, 2015
@divega thank you for answer =)
rowanmiller commentedon Oct 9, 2015
This work is covered by #240
divega commentedon Jun 3, 2017
Reopening to prioritize separately from the main flexible mapping issue.
Initial implementation of lazy-loading and entities with constructors
Initial implementation of lazy-loading and entities with constructors
Initial implementation of lazy-loading and entities with constructors
Initial implementation of lazy-loading and entities with constructors
Initial implementation of lazy-loading and entities with constructors
Initial implementation of lazy-loading and entities with constructors
max-arshinov commentedon May 28, 2019
Hi guys. What is the status of this issue? It looks that according to the roadmap (https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/features) it will not be implemented in EF Core 3.0. Will it?
bricelam commentedon May 28, 2019
Some support for constructor injection was added in 2.1.
smitpatel commentedon Nov 13, 2019
@ajcvickers - What is pending in this issue? Should we track it differently?
ajcvickers commentedon Nov 14, 2019
@bricelam @smitpatel This is actually about being able to inject services registered in the application D.I. container. We haven't implemented this yet.
AndriySvyryd commentedon Sep 21, 2021
Related to #13540