DTO, WebSvs, JSON

Posts   
 
    
Posts: 94
Joined: 23-Aug-2006
# Posted on: 24-Dec-2012 18:00:44   

Whats the current recommended usage for LLBLGen when working with Web Svs. ( Microsoft Web API or ServiceStack based REST service)

  1. Is there a recommended template one can use to produce DTO's?
  2. I saw Frans blog post of producing Entities that serialize to JSON - is there an advantage to going that route over DTO's?

http://weblogs.asp.net/fbouma/archive/2012/10/05/how-to-make-asp-net-webapi-serialize-your-llblgen-pro-entities-to-json.aspx

Thanks Thomas

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Dec-2012 05:35:13   

etechpartner wrote:

Whats the current recommended usage for LLBLGen when working with Web Svs. ( Microsoft Web API or ServiceStack based REST service)

Hi Thomas. That are three different things: WCF WebServices, WebApi and REST (which can be seen as a behavior endpoint of WCF).

LLBLGen can work with all of them with the built-in Entity classes. The link you posted, for instance, mention how to make them work with WebApi.

etechpartner wrote:

  1. Is there a recommended template one can use to produce DTO's?

There is no "DTO's official templates", but a user kindly posted his own implementation, see http://llblgen.com/TinyForum/Messages.aspx?ThreadID=13256 You can write your own, of course.

etechpartner wrote:

  1. I saw Frans blog post of producing Entities that serialize to JSON - is there an advantage to going that route over DTO's?

The advantage is that you don't have to write and maintain your DTO's classes. It works for Entity classes right away.

David Elizondo | LLBLGen Support Team
Posts: 94
Joined: 23-Aug-2006
# Posted on: 18-Jun-2013 20:37:30   

Just in case another person has a similar question, I ended up using Matt Conway's fantastically excellent templates that work with ServiceStack to produce all the DTO's and more . ( We had already decided on using ServiceStack so this fit right in) I dont think Matt's code is in the LLBLGen downloads but it is certainly on Git. I highly recommend his work.

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 18-Jun-2013 21:02:42   

Thanks for the feedback.