Which layer of the application should contain DTO implementation

后端 未结 6 875
再見小時候
再見小時候 2021-01-31 04:11

Lately I\'ve been hearing a lot about DTOs and how useful they are but I can\'t find a good example of using it in ASP.NET context.

Let\'s say I use three tier architect

6条回答
  •  我在风中等你
    2021-01-31 05:14

    There should not be any conversion. You would just use Poco Objects as DTO.

    EF works with Poco and they can be serialized by WCF.

    They should be defined in an assembly that is refernced by all projects.

    In ASP.NET MVC you would mapp to a ViewModel by using the Poco - DTO.

提交回复
热议问题