Skip to content

Support DI for contructors of POCO #3342

Open

Description

Hello EF Development team.
I have a question about dependency injection.
Does EF looking for dependencies when materializing object from database in this manner ?

public class Person 
{

   public Person(DataContext context)
   {
    ....
   }

   // or maybe like this
   [Dependency]
   public DataContext Context {get;set;}
}

After loading and materializing from database DataContext(DataContext is inherited from DbContext) must injected in constructor.

Anything like this is possible now ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions