gothinkster / aspnetcore-realworld-example-app

ASP.NET Core backend implementation for RealWorld
https://realworld.io
MIT License
1.93k stars 548 forks source link

Why Envelope return Domain object? #36

Open marcrib opened 6 years ago

marcrib commented 6 years ago

Why Envelope return Domain object?

Is bad practices

adamhathcock commented 6 years ago

Says whom?

One of the goals of Feature orientation is to reduce needless layers of abstraction. Validation for web and db occurs via MediatR pipelining

marcrib commented 6 years ago

@adamhathcock hi, there may be circular properties and also properties that I do not want to return. Using JsonIgnore seems to mess up the application domain

adamhathcock commented 6 years ago

If you need to make a DTO then do it. Only do what you need to. Be agile. Don’t make layers for no reason.

Using a serialization attribute doesn’t mess up a domain.

Deilan commented 6 years ago

@adamhathcock How to leverage DTO-approach with MediatR, AutoMapper and FluentValidation? Could you kindly provide a sample or point into appropriate direction?

aarrttzz commented 7 months ago

https://github.com/aarrttzz/aspnetcore-realworld