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

  • SEARCH
  • Home
  • 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 4602834
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:03:03+00:00 2026-05-22T00:03:03+00:00

I am trying to convert Enterprise Library TypeRegistration ConstructorParameters to a collection of key/value

  • 0

I am trying to convert Enterprise Library TypeRegistration ConstructorParameters to a collection of key/value pair (a HashTable or an IDictionary in general).

The ConstructorParameters property is an IEnumerableOf(ParameterValue) so my problem is how to extract the values from each ParameterValue object.

Every ParameterValue object contains a Type and an Expression.

For ex. if a ParameterValue contains: “EventLoggingEnabled = false”
then I can get the key (which is the EventLoggingEnabled) using expression.Member.Name
but I can’t find a way to get the value (which is “false”).

Any thoughts?

  • 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-05-22T00:03:05+00:00Added an answer on May 22, 2026 at 12:03 am

    Have you looked at the implementation of the UnityContainerConfigurator? Even if you don’t want to use Unity, you can see how the type registration stuff is handled there and adapt to the Windsor API.

    You generally don’t need to code to the raw ParameterValue class and poke through the lambda expressions. There are actually three subclasses:

    • ConstantParameterValue
    • ContainerResolvedParameter
    • ContainerResolvedEnumerableParameter

    The ConstantParameterValue gives you the value directly as the .Value property. ContainerResolvedParameter is used when the value of the parameter needs to be injected by the container, and ContainerResolvedEnumerableParameter is used when you have a collection that needs to be injected. Every instance of ParameterValue is actually one of these types.

    So, what you should do is try to cast to each one, and then switch based on the actual type. There’s a utility base class, ParameterValueVisitor, that lets you implement the Visitor pattern over ParameterValues to make your code cleaner.

    So, what I’d do is drop the picking through lambdas – you don’t need to do it. Implement a visitor to pull out the information you need using the base class, then the pre-digested information will be available to you in the concrete classes. Look at the UnityContainerConfigurator for an example of how this is done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'trying to convert a float to an int value in php: var_dump((int)(39.3 * 100.0));
Am trying to convert my string value(the value is millisecond value) from seconds. Here
Trying to convert a date & time value in the format of 07/19/2011 00:00
Whilst trying to convert the number from the value of a numericupdown to an
i´m using subsonic 3 trying convert a SQL2008 project to MySQL. when the projects
Trying to convert the following but am having difficulty. Can anyone see where I'm
Trying to convert this c code into MIPS and run it in SPIM. int
Trying to convert int arrays to string arrays in numpy In [66]: a=array([0,33,4444522]) In
Im trying to convert unixtime to date but the results im getting are wrong
Im trying to convert the Vaadin demo for JPAContainer to use hibernate instead of

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.