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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:16:05+00:00 2026-06-02T17:16:05+00:00

I have my service layer, entities and DTOS in a separeted assembly called CCL.Data

  • 0

I have my service layer, entities and DTOS in a separeted assembly called CCL.Data

The problem:

All My application is referencing the service layer directly using interfaces and IoC.

For example, I have an interface in my CCL.Data assembly called ICustomerService it depends on ICustomerRepository that depends on MyContext. All my application is referencing ICustomerService to call its methods……. so far no problem.

So I created a WCF Project…. referencing CCL.Data in this project….

I create a new Service, but int this case below, I would need to change all points in my application that call ICustomerService to WCFCustomerServiceClient, does exists a better way without cause a big impact in my project?


    [ServiceContract]
    public interface IWCFCustomerService
    {
        [OperationContract]
        CustomerDTO GetCustomerById(int id);
    }

    public class WCFCustomerService : IWCFCustomerService
    {
        ICustomerService _customerService;
        public WCFCustomerService() 
        {
            MyContext context = new MyContext();
            ICustomerRepository customerRep = new CustomerRepository(context);
            _customerService = new CustomerService(customerRep);
        }

        public CustomerDTO GetCustomerById(int id)
        {
            return _customerService.GetCustomerById(id);
        }

    }


Tks,
William

  • 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-02T17:16:06+00:00Added an answer on June 2, 2026 at 5:16 pm

    Do you need to redefine IWCFCustomerService in place of ICustomerService? Is it not possible just to add ServiceContract attributes to your original ICustomerService interface (they will just get ignored by non WCF code)? (Its true that this does give you a dependancy on ServiceModel – but I cant see a way out of that).

    Note also that if you use a ServiceRefernce to generate proxy code then the code generated will include a your service interface in different namespace for use clientside. Its worth noting that your not abliged to use that version of the interface (which could be annoying if you have a proxy and not proxy implimentation) but can still use the org interface definition either from a dll or compiled into your client.

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

Sidebar

Related Questions

I have an asp.net mvc application with three layers: - data layer with entities
I have a built an MVC application with a model layer containing entities, data
I have a service, business and data access layer. In which layer should I
I have a layered application with namespaces: App.Core - business layer logic services App.Data
I have a service layer returning a collection of entities : /// <summary> ///
I have a WCF service layer which uses pure DTOs. On the server side,
I have to expose an ejb service layer via jax-ws . I have generated
I have the standard repository pattern with a service layer and I need to
I have this sort of format asp.net MVC View -> Service Layer -> Repository.
I have a pecular problem in my WCF in the web services layer. When

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.