Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:34:08+00:00 2026-06-14T10:34:08+00:00

Suppose all the dependencies have already been registered at the beginning of the program.

  • 0

Suppose all the dependencies have already been registered at the beginning of the program. At later points in the program how can you use AutoFac to create a new object with a parameterless constructor and inject the registered properties into the object?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:34:09+00:00Added an answer on June 14, 2026 at 10:34 am

    You can register your object in the container with PropertiesAutowired then use resolve when you need an instace:

    ContainerBuilder builder = new ContainerBuilder();
    // builder register other dependencies
    builder.RegisterType<MyObject>().PropertiesAutowired();
    
    var container = builder.Build();
    
    var myObject = container.Resolve<MyObject>(); //the properties will be filled
    

    Or if you don’t want to register in the container your can use the InjectProperties method on an existing instance:

    ContainerBuilder builder = new ContainerBuilder();
    // builder register other dependencies
    
    var container = builder.Build();
    
    var myObject = new MyObject();
    container.InjectProperties(myObject); //the properties will be filled
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have all of these already provided: The name of a table
Suppose I have the following code to collect all the possible combinations. abArray =
Suppose I have a customer object that has all of the standard customer properties
Suppose we have abstract class A (all examples in C#) public abstract class A
Suppose I have a column called fruits I want to select all of the
Suppose I have class Foo(db.Model): bar = db.ReferenceProperty(Bar) foo = Foo.all().get() Is there a
Suppose I have a module A:jar , whose runtime and compilation set of dependencies
Suppose all the databases involved in a distributed transaction implemented with two-phase commit signal
Hello i'm testing the following code it's suppose to list all apps installed on
Suppose you take the strings 'a' and 'z' and list all the strings that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.