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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:16:51+00:00 2026-05-28T18:16:51+00:00

We have a multi services application. We have moved a method that involves a

  • 0

We have a multi services application. We have moved a method that involves a DB access to a separate component that is exposed by a WCF endpoint.

We have 2 options:
1. A WCF call to the method.
2. Call directly to the method, resolved by our DI engine.
The system performance is a critical issue, so we want to switch between option 1 and option 2 via configuration file with out recompiling client application.
Any tips or suggestions to this idea/architecture?

  • 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-28T18:16:52+00:00Added an answer on May 28, 2026 at 6:16 pm

    You can teach Unity to resolve WCF services by interface. So it does not matter wether you resolve a local implementation of your service or a WCF one. You will always inject an IMyService into your classes. It’s just a change of your configuration.

    You can configure the extension to use app.config or WCF discovery or explicitely specify Binding and EndpointAddress in code.

    See the TecX project for further information. The source code is located in TecX.ServiceModel.AutoMagic. Some tests that demonstrate the usage can be found in TecX.ServiceModel.Test


    Update

    Define an interface for your service (e.g. IMyService) and decorate it with the necessary attributes (DataContract, OperationContract). Implement that interface (e.g. in class MyService). MyService calls your method. Now tell Unity to either map IMyService directly to MyService or add the container extension that allows you to map IMyService to a proxy generated by the WCF ChannelFactory. Deploy your service and you are done. Unity will inject whatever implementation of IMyService into the constructors of those classes that need them.

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

Sidebar

Related Questions

I have web application with WCF service. That service contains method that implements message
I have a multi-timezone web application that stores all of the datetime values in
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
In our multi-tier business application we have ObservableCollections of Self-Tracking Entities that are returned
We have a typical multi-tier/layer architecture. Application + WCF Service + Repository/EF4/Database. We are
I have a method that calls two services from PHP at the same time.
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
I have a multi-line string that I want to do an operation on each
I have a C++ Win32 application that was written as a Windows GUI project,
I have a multi page windows phone application. I have a main page and

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.