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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:45:01+00:00 2026-06-10T19:45:01+00:00

I have an interface that describes two objects. One is a DAO, the other

  • 0

I have an interface that describes two objects. One is a DAO, the other is a BO. So, here’s what it looks like:

public interface IOrder ...

public class OrderDAO : IOrder ...

public class OrderBO : IOrder ...

And I would like to map OrderDAO to OrderBO. My original line of thought was that I could simply map interface to interface and supply both concrete objects, like so:

AutoMapper.Mapper.Map<IOrder, IOrder>(myOrderDAO, myOrderBO);

However, this did not work out-of-the-box. I still had to create a map in order to get the data from myOrderDAO to myOrderBO.

AutoMapper.Mapper.CreateMap<IOrder, IOrder>();

I’m not sure that makes a lot of sense to me and I feel like I’m “doing it wrong”, as it were. So my question is two-fold.

  1. What is the best way to map in the above scenario?
  2. Why would I need to create a map for the same interface?

Thanks in advanced.

  • 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-10T19:45:03+00:00Added an answer on June 10, 2026 at 7:45 pm
    1. this is a good way to map. However if you want to reduce number of CreateMap calls, create a method that would create all maps and then call it once per application domain. for example from some static constructor or another app start event. see how they recommend it in their Get Started

    2. even it is for the same interface there still should be a map, I guess. on the bright side it makes your life easier, you do not have to create maps like and a lot more. It could be an optimization though.

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

Sidebar

Related Questions

I have an interface that has two toolbars, one attached to the frame and
I have an interface that, among other things, implements a public IEnumerator GetEnumerator() method,
I have an interface that has a generic method with two type parameters. I
I would like to create application with ribbon interface that looks and behaves like
I want to create an interface that has one or two listviews that ultimately
So, in Interface Builder I have a view within the superview that contains two
I have a validation interface like so: public interface IValidation<T> { bool IsValid(T item,
I have a basic MVC pattern created in Java that uses the Observable/Observer class/interface.
I have an interface that has large numbers of controls, see image below. Interface
I have an interface that defines the ability to persist an entity 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.