I was reading this book about WCF services. What it said was to create a WCF service which contained an entity model of the database. For example, lets say this database had a table called User. The author then went to create a new class called UserDto which contained almost exactly the same fields as those in the database table for the User. The reason, he said, for doing this was that when passing data through WCF you don’t want to pass the actual entity created object as it contains data that is not needed (and uses up bandwidth).
What I wanted to find out, is there some kind of class generator in order to construct these transport classes for me? If I have a database of 10 or more objects I don’t want to sit and hard code 10 objects in the business layer. Is there a tool that can do something like this for me (i.e. a code generator)?
Or can anyone suggest a better way of doing this?
http://visualstudiogallery.msdn.microsoft.com/23df0450-5677-4926-96cc-173d02752313
This was exactly what I was looking for!