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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:27:31+00:00 2026-05-13T09:27:31+00:00

After reading about Enitity Framework , i have some questions: 1] What is the

  • 0

After reading about Enitity Framework , i have some questions:

1] What is the best way to transfer Entities between tiers ?
a] do i must create lighter DTOs for this or i can Effectively serialize the Entitiy and transfer it ?

b] if i must create light DTOs,for Efficency, and after i saw the nice usage of Automapper ,
i didnt quite understand how it saves extra coding (if it is its goal) ,
i mean, we need to write the flattern class(DTO) properties , so its only saves the ctor.

2] is there any point Building Entitiy Classes back from DTOs ?

thanks.

  • 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-13T09:27:32+00:00Added an answer on May 13, 2026 at 9:27 am

    Answer to 1:
    The best way to transfer entities between tiers depends on your application. You can create DTOs which is my preferred solution though serializing entities is possible but you need to make sure this is actually what you want to do and remember:

    “When you use binary serialization and WCF data contract serialization, if the object being serialized has related objects in the object graph, those objects are also serialized. XML serialization does not serialize related objects.”

    Automapper works by mapping properties automatically rather than having to write all of the plumbing statements such as:

    dto.id = entity.id;
    ...
    all other dto assignment operations
    

    you soon see the amount of plumbing code add up so will save quite a lot of this = that lines of code especially if you have view classes as well as dto objects and I found this fitted what I wanted perfectly. As far as i am aware automapper will only work if the names are the same between the entity and DTO and it can map between the types of these properties. You can add mapping rules for converting between types though if the dto and entity store the data in a different type.

    Answer to 2:
    If you convert objects to DTOs and modify them at higher tiers how do you plan on saving them back through the entity framework? Usually you would just convert these back onto the related entities / create a new entity and submit these changes.

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

Sidebar

Related Questions

After reading an article about the subject from O'Reilly , I wanted to ask
After reading a bit more about how Gnutella and other P2P networks function, I
After reading this discussion and this discussion about using CrashRpt to generate a crash
After reading Practical Common Lisp I finally understood what the big deal about macros
After, reading and understanding Dan Benjamin's post about installing Ruby, Rails, etc. on OSX
After reading about Firefox's Geolocation functionality, which doesn't use GPS , I'm wondering what
after reading about sequence points, I learned that i = ++i is undefined. So
After reading about VA_NARG I tried to implement function overloading depending on number of
After reading the Head First Design Patterns book and using a number of other
After reading this question , I was reminded of when I was taught Java

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.