question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support DI for contructors of POCO

See original GitHub issue

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 ?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:4
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ajcvickerscommented, 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.

0reactions
AndriySvyrydcommented, Sep 21, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I access DI registered instance from within POCO?
A POCO could be anything from a domain layer component (containing behavior) that uses constructor injection to an Entity, from a DTO to...
Read more >
Constructor Injection for POCO ViewModels question
The following help topic describes how to use DI frameworks with DevExpress controls: Dependency Injection. You can find sample projects ...
Read more >
POCO ViewModel with Constructor Injection in Xaml
The following help topic describes how to use DI frameworks with DevExpress controls: Dependency Injection. You can find sample projects there.
Read more >
POCO Data User Guide
Currently supported database connectors are SQLite, MySQL/MariaDB, PostgreSQL and ODBC (which covers SQL Server and other databases). Framework is opened for ...
Read more >
Class Poco::Util::ServerApplication
For a ServerApplication to work both from the command line and as a daemon or service, a few rules must be met: Subsystems...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found