Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Converting Business Object to Data Transfer Object

Converting Business Object to Data Transfer Object

Scheduled Pinned Locked Moved C#
csharpwcfbusinessarchitecturehelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saiyed Alam
    wrote on last edited by
    #1

    Hello... I'm new to WCF. I'm working on a architecture where I need to convert my Business object class to Data Transfer Object class for accessing web service. At the same time I need to do the opposite. but I don't know how to this conversion? Any help would be appreciated, specially with code sample. Thanking in Advance Johnny

    C T 2 Replies Last reply
    0
    • S Saiyed Alam

      Hello... I'm new to WCF. I'm working on a architecture where I need to convert my Business object class to Data Transfer Object class for accessing web service. At the same time I need to do the opposite. but I don't know how to this conversion? Any help would be appreciated, specially with code sample. Thanking in Advance Johnny

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'd be astounded if half the point of WCF was not that it offers this type of serialisation for you. Even web services, which WCF will wrap, I believe, will do that for you.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      S 1 Reply Last reply
      0
      • C Christian Graus

        I'd be astounded if half the point of WCF was not that it offers this type of serialisation for you. Even web services, which WCF will wrap, I believe, will do that for you.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        S Offline
        S Offline
        Saiyed Alam
        wrote on last edited by
        #3

        Thanks for your quick response. Actually i have to transfer the business object from my Desktop app to a remote WCF service .That's why i think i have to convert my business object to DTO and vice versa. How can i do this?

        C 1 Reply Last reply
        0
        • S Saiyed Alam

          Thanks for your quick response. Actually i have to transfer the business object from my Desktop app to a remote WCF service .That's why i think i have to convert my business object to DTO and vice versa. How can i do this?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I don't know for sure, I just know that if you need to do any sort of conversion, then WCF only makes it harder to use a webservice, because I've written plenty of webservice clients and webservices, without ever having to do this. Also, please don't cross post.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          • S Saiyed Alam

            Hello... I'm new to WCF. I'm working on a architecture where I need to convert my Business object class to Data Transfer Object class for accessing web service. At the same time I need to do the opposite. but I don't know how to this conversion? Any help would be appreciated, specially with code sample. Thanking in Advance Johnny

            T Offline
            T Offline
            Tobias82
            wrote on last edited by
            #5

            Hello Johnny, converting a BO to a DTO is a manual task which has to be done by yourself and not by WCF. But there is a sweet library called AutoMapper (http://automapper.codeplex.com/[^]) I can highly recommend. Its a convention-based object-object mapper which can handle the BO-to-DTO mapping and vice versa for you. Take a look and enjoy :-) Greetings, Tobias

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups