Skip to content

I'm currently working on a small mvc project. On itself nothing special, I'm a big supporter of the ...

Olivier Muhring

Olivier Muhring

Asked Jun 15, 2012, 7:10 AM EDT2 answers
Share
LinkedInX
I have datalayer which uses EF 4.1 to communicate with a database. On top op this I've added a datamodel-project, which basically translates between EF's POCO-classes and the DTO-objects I use further along in the application (business and UI)

I'm doing this straightforward, manually mapping and creating my objects as I go along.  I've used this approach, with great success, in several other projects. In my current project however, a colleague has made several objections. She thinks working my way would in essence mean throwing away a lot of the power of the Entity Framework. To circumvent this, she wants to write a wrapper around my POCO or my DTO classes (not sure which) and use that wrapper to write a convertor, so as to automatically map my POCO classes to their DTO counterparts and so  on.
I personally believe this to be overkill, but I do understand her objections.

In some fields of C# I'm still somewhat of a novice so far, so I'm at a loss at what to do now. How you undertake writing a wrapper (what is wrapper anyway) around a class, and then how do you write a converter?

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
     A wrapper class is any class which encapsulates or hide the functionality of another class or the internal representation of an object. 

     To your other question, I don't have much knowledge about repository pattern approach.

     Let's wait for more reply from experienced person.
    0
  • Olivier Muhring
    0
    I can hardly wait... So far she has resolved the problem by reusing a "Convertor" class which translates between the DTO classes and the POCO classes used by EF.
    0