Web Api Shares DTO

I am creating several mvc 4.0 web services on an internal network. I came from the WCF WSHttp background where we shared a common DTO and contract between the Service and the client.

With web api should dtos be shared between client and service? Or this is bad practice, and I should just let the client try and deserialize json for any object structure he wants. What in my case can lead to dtos duplication in the client and service?

thanks for the help

+4
source share
1 answer

I am currently working on an n-tire web project, and our DTOs are stored in a public library that the service tier and MVC website use. We found this to be the most logical, and it stops duplication, while maintaining the level of separation.

I hope this helps and good luck!

+2
source

Source: https://habr.com/ru/post/1482164/


All Articles