workcontrolgit / TemplateKissAPI

5 stars 1 forks source link

Do you use DTO? #2

Open biapar opened 3 years ago

biapar commented 3 years ago

Do you use DTO?

workcontrolgit commented 3 years ago

Yes. For me, I equate DTO to a view in the database. In the traditional MVC, the DTO is great. When working on REST API, I prefer CQRS pattern and implement using MediatR and AutoMapper. It makes code cleaner and easier to test/maintain.

biapar commented 3 years ago

Automapper to map data class to model class returned by api. MediaR for? Which is a good panel to made CRUD operations on data as backend panel for a mobile app? I like Strapi.io but I like a similar thing for .NET Core so I've more control on it.

biapar commented 3 years ago

CQRS https://docs.microsoft.com/it-it/azure/architecture/patterns/cqrs So you use MediaR to write data with commands and read by handlers. MediaR is like MessageBus into Xamarin. Then the commands after mediaR can be queued ti a queue and sent to database.

biapar commented 3 years ago

Maybe an update for this template.