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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:15:09+00:00 2026-05-24T23:15:09+00:00

I have a WCF service layer which uses pure DTOs. On the server side,

  • 0

I have a WCF service layer which uses pure DTOs.

On the server side, I take these DTOs and pass them to my business logic layer, basically a set of “Manager” classes for each entity or group of entities.

The Manager class methods take in a DTO as a paramater, in the first lines of each method, I take the DTO and using AutoMapper, map it to my Entity Framework POCO. Then I do my LinQ queries or repository methods (I’m using DBContext from EF 4.1), and if needed, map the result entity back to a DTO and return it back to WCF service method.

Almost every method in my Manager class is doing this mapping and remapping, it’s a ton of repetative boilerplate code. Any suggestions on a pattern I can use to reduce redundancy?

  • 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-24T23:15:09+00:00Added an answer on May 24, 2026 at 11:15 pm

    We place all mappings in a separate dll. It makes it easier to test, and removes the need for duplicate code.

    You can also reduce the amount of code further by using automapper, see: http://automapper.codeplex.com/

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

Sidebar

Related Questions

I have a WCF service layer in my application that passes DTOs to UI.
I have a WCF service which will be hosted under IIS. Now I have
We have a WCF service that uses Entity Framework to query a SQL database.
I have a data access layer which returns an IDataRecord. I have a WCF
I have a WCF service that uses ODP.NET to read data from an Oracle
I have a WCF Service class PersonService which can save Person and his/her Address
I am designing a WCF service using DDD. I have a domain service layer
We have a typical multi-tier/layer architecture. Application + WCF Service + Repository/EF4/Database. We are
We have an application in which we have created a service layer with most
We have a WebRole which deals with request coming in off a WCF service,

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.