vendredi 31 août 2018

DTOs that are too heavy to be shared

I have a domain entity currently within my application which exposes functionality via wcf and restful api - where the properties are decorated with various attributes - like SwaggerWCF for example, and some validation rules like [Mandatory].

Now this is fine, however I am now working on a client library to faciliate consuming the services. The typical pattern I follow here is to break the DTOs out into a separate nuget package which is then used by the service and the client.

However these DTos are heavy - hell they probably aren't arent even dtos.

How can I expose my lovely POCOS as Dtos and then layer up the extra stuff on the service side?

I can only see duplication on the road ahead....

Aucun commentaire:

Enregistrer un commentaire