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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:07:07+00:00 2026-05-12T21:07:07+00:00

There was a very interesting discussion on LosTechies regarding AutoMapper(an argument for/against 2-way mapping).

  • 0

There was a very interesting discussion on LosTechies regarding AutoMapper(an argument for/against 2-way mapping).

This actually caught my attention due to the problem I’m currently working through. I’m working on a shipment piece to provide information such as rates/delivery times to my users. To centralize the actual services, I have a WCF web service which persists any domain entities.

To simplify the domain model I basically have 2 classes:

public class Shipment
{
 public IList<Item> Items{get;set;}
}

public class Item
{
 //some primitive properties
}

I also have a corresponding set of DTOs that were created to lighten the load across the wire. The presentation piece(or pieces, whatever touches the web service), use the DTOs with no knowledge of the domain model.

My question comes here. To create a shipment, the service accepts a list of items. There is logic to creating shipments, which is all hidden behind the web service. In essence, this means that ItemDTO is passed across the wire(client -> server), shipments are created, then ShipmentDTO is passed back(server -> client). Now, ShipmentDTO has a child list of ItemDTO as well, which creates the 2-way mapping scenario.

This is more than a simple CRUD operation and I’m farely new to the Command Message pattern, so I’m curious how the community would solve this issue.

Do you pass a DTO both ways with 2-way mapping?

Sample usage(presentation layer):

List<ItemDTO> list = new List<ItemDTO>();
//add items to list


ShipmentServiceClient client = new ShipmentServiceClient();
List<ShipmentDTO> shipments = client.GetShipments(list);

//shipments are now displayed to the user
//with respective costs and other useful data
  • 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-12T21:07:08+00:00Added an answer on May 12, 2026 at 9:07 pm

    Something that was mentioned in that post that I didn’t quite grasp was the wording in a response. “Incoming DTOs are mapped to command messages”. Saying, DTOs can be bidirectional, the mappings(AutoMapper) provided, however are unidirectional.

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

Sidebar

Related Questions

In this post there's a very interesting way of updating UI threads using a
there's this interesting problem i can not solve myself. I will be very glad,
Ok, this is a very interesting question and there may not be any easy
I realize there is a very interesting technique, to get Context in Android in
Ruby has this very interesting functionality in which when you create a class with
This is a very interesting thing. I have an APK file, com.company.app.apk. When installed
This is very interesting.. I want to have multiple gridviews in a panel. and
Here i have a very interesting topic for discussion or you can say i
I found the jQuery Cycle plugin which is very interesting. So, there is the
I found this question very interesting : Programmatic Bot Detection I have a very

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.