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 8630373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:02:49+00:00 2026-06-12T09:02:49+00:00

I have services as follows: class Order interface IOrderService void SendOrder(Order order) class SmsOrderService:IOrderService(constructor

  • 0

I have services as follows:

class Order

interface IOrderService
    void SendOrder(Order order)
class SmsOrderService:IOrderService(constructor ISmsService)
class FaxOrderService:IOrderService
class MailOrderService:IOrderService

interface ISmsService
    void SendSms(string message,string phone)
class XSmsService
class YSmsService(constructor YSmsServiceConfiguration)

class YSmsServiceConfiguration
    string Username
    string Password

class OrderManager(constructor IOrderService)
    void SendOrderAndLog(Order order)

I need use OrderManager with all of IOrderService implemented class.

My windsor config is:

static void Main(string[] args)
    {
            WindsorContainer container = new WindsorContainer();
            // OrderManager implementations
            container.Register(Component.For<OrderManager>()
                                   .ImplementedBy<OrderManager>()
                                   .Named("OrderManagerWithSmsService")
                                   .DependsOn(Property.ForKey<IOrderService>().Is<SmsOrderService>()));

            container.Register(Component.For<OrderManager>()
                                   .ImplementedBy<OrderManager>()
                                   .Named("OrderManagerWithFaxService")
                                   .DependsOn(Property.ForKey<IOrderService>().Is<FaxOrderService>()));

            container.Register(Component.For<OrderManager>()
                                  .ImplementedBy<OrderManager>()
                                  .Named("OrderManagerWithMailService")
                                  .DependsOn(Property.ForKey<IOrderService>().Is<MailOrderService>()));

            // IOrderService implementations
            container.Register(Component.For<IOrderService>()
                                   .ImplementedBy<SmsOrderService>());
            container.Register(Component.For<IOrderService>()
                                   .ImplementedBy<FaxOrderService>());
            container.Register(Component.For<IOrderService>()
                                   .ImplementedBy<MailOrderService>());

            // ISmsService implementations
            container.Register(Component.For<ISmsService>()
                .ImplementedBy<YSmsService>()
                .DependsOn(Property.ForKey<YSmsServiceConfiguration>().Eq(GetConfiguration()))
                .Named("YSmsService")
                .LifestylePerThread());

            container.Register(Component.For<ISmsService>()
                .ImplementedBy<XSmsService>()
                .Named("XSmsService")
                .LifestylePerThread());

            var manager = container.Resolve<OrderManager>("OrderManagerWithSmsService");
            manager.SendOrderAndLog(new Order()
                                       {
                                           ProductName = "New York Steak"
                                       });
            manager.SendOrderAndLog(new Order()
                                    {
                                        ProductName = "Red Wine"
                                    });

            Console.Read();
    } 

How can i use YSmsService in OrderManager using effective windsor configuration?

like this: container.Resolve(“SmsOrderService(YSmsService)”); // parse key for determinate constructor parameters

not like this:

    var manager = container.Resolve<OrderManager>(new
    {
        orderService = container.Resolve<IOrderService>( new
                {
                    service = container.Resolve<ISmsService>("YSmsService")
                })
    });
  • 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-12T09:02:50+00:00Added an answer on June 12, 2026 at 9:02 am

    This is called service override and you’re already using it. What’s the problem again?

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

Sidebar

Related Questions

For development of web services, i have to make multilevel Associative array as follows
In RIA services the EntityCollection<T> class is defined as follows : public sealed class
I have an application structured as follows: dao domain main services utils I've made
I have a custom class declared as follows (in vb.net) <Serializable()> Public Class NumInfo
I have to provide an interface to a set of web services for which
I have a service, as follows: The most basic (working) CherryPy 3.1 Windows service
I have two Services called TemplateService, TemplateReportService (both defined in one WCF Service Library)
Various online services have different values for maximum year of expiry, when it comes
I have found services like ClearSpring and Widgetbox for putting content snippets onto a
I have two services, one that calls another. Both are marked as singletons as

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.