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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:17:04+00:00 2026-05-28T07:17:04+00:00

I have a number of Data Transfer Objects (DTO’s) that map onto data structures

  • 0

I have a number of Data Transfer Objects (DTO’s) that map onto data structures in a binary file. Some of the fields in these objects map to enums, like this one:

public enum DataChecksumExistence
{
    None = 0x00,
    Eight_Bits = 0x01,
    Sixteen_Bits = 0x02,
    Thirty_Two_Bits = 0x03
}

Other fields are just numbers or boolean bit values.

I have an extension method ToList() on Enum that returns a list of key-value pairs from any Enum that can be stuffed into a dropdown in the Form_Load:

uxDataChecksumExistence.DataSource = typeof(DataChecksumExistence).ToList();

In a public property of the Winform that returns an instance of my DTO, I have the following in the getter:

dto.DataChecksumExistence 
    = (DataChecksumExistence)uxDataChecksumExistence.SelectedValue

and the following in the setter:

uxDataChecksumExistence.SelectedValue = dto.ChecksumSize;

Multiply this code by about 50 fields, and then multiply it again by the number of forms I will need in my application (it is dozens), and you can see my dilemma.

Is there a way to use Automapper to do this? Or would it be better to code-gen it with something like T4 templates? Please provide a code sample if you can; I don’t need the whole Bible, just a few verses to get pointed in the right direction.

  • 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-28T07:17:05+00:00Added an answer on May 28, 2026 at 7:17 am

    It is not possible with automapper, but you can see here (http://valueinjecter.codeplex.com) in the Demo a winforms project which uses mapping, you can also see a screenshot of the demo on the frontpage.

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

Sidebar

Related Questions

I have a number of images and a CSV data file that I want
I have a number of different data sources that I need to query and
I have a number of large data files that I included in projects attributed
We have a number of very old data entry forms that were made in
I have a number of tables containing some basic (business related) mapping data. What's
I have a defined number of servers that can locally process data in their
I have a data transfer tool that transfers information from one database to another.
I have a number data-driven web based applications that serve both internal and public
I have a number of data classes that have over 25 properties of different
I have a number of data classes representing various entities. Which is better: writing

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.