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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:53:16+00:00 2026-05-23T11:53:16+00:00

In my business layer, i am using WCF service. WCF service instance can be

  • 0

In my business layer, i am using WCF service. WCF service instance can be passed in the constructor as well. Here are the constructors of my BL.

    private IWCFClient wcfClient;

    public MyBL()
        :this(new WCFClient())
    {

    }

    public MyBL(IWCFClient wcfClient)
    {
        serviceClient = wcfClient;
    }

because i am declaring my wcfClient as an interface, i dont get .Close() method there. I have to typecast it to close it as ((RealwCFClient)wcfClient).Close();

Is there a way i can close my client without typecasting it? Should i expose a Close method in my interface?

  • 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-23T11:53:17+00:00Added an answer on May 23, 2026 at 11:53 am

    Cast your object to ICommunicationObject and then .Close() it.

    Note that Close() can throw an exception, in this case catch it and do .Abort()

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

Sidebar

Related Questions

Our projects are using objects as the data source to reports. Our business layer
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer
I've an application that offers its Business Layer through a Service Layer developed with
I'm developing a web service using NHibernate, WCF and Oracle 11g R1. The web
I am using a WCF service between the Client side UI (Silverlight 3.0) and
I have a WCF service layer which uses pure DTOs. On the server side,
I currently represent my Business Layer and Data Layer in a single project in
I have a Business Layer that passes a Conn string and a SQLCommand to
When your domain layer or business layer (whatever you want to call it) is
I have just branched our Common Business Layer projects from the main to a

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.