Skip to content

Support DI for contructors of POCO #3342

Open
@Artur2

Description

@Artur2

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 ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions