Comet icon indicating copy to clipboard operation
Comet copied to clipboard

How to deal with DTOs

Open Martinn2 opened this issue 3 years ago • 1 comments

For me, one of the main reasons to do front end development in C# is the ability to share models (DTOs) between ASP.NET CORE API and UI.

When using MVVM it is possible only to share interfaces because UI properties must implement INotifyPropertyChange.

In Blazor, sharing is possible as no interface is needed.

Commet seems to me the same as MVVM in this point of view as it needs INotifyProertyRead.

Is there any way / plan how to use shared DTO returned from API and bind to them from UI ?

Martinn2 avatar Jun 08 '22 15:06 Martinn2

There is a SourceGenerator, that will auto wrap any standard class to handle INotifiyProperytChanges: GenerateStateClassAttribute. This will make it easy to use!

Clancey avatar Jun 08 '22 23:06 Clancey