blazorgenui icon indicating copy to clipboard operation
blazorgenui copied to clipboard

Generate CRUD UI form EF Core Modal

Open ElderJames opened this issue 5 years ago • 2 comments

Hi @Specter-13 This is a good project. And I noticed that currently it just use DTO to generate UI.But I think it's possible to include the bankend.

ElderJames avatar Apr 25 '21 22:04 ElderJames

Hello @ElderJames , Thank you. Yes, currently this project is focusing solely on DTO objects, since they don't contain any logic and are rather simple. But yeah, it could be possible to modify it to work with backend classes. I can imagine working it on server-side Blazor. But I assume, your backend classes are way more complex than dtos, therefore we will need to figure out way how to specify things, which should generate as UI. Currently, I use method from System.Type GetRuntimeProperties(), where as a result I acquire list of public properties containing data. You can look into BlazorGenUI.Reflection/ComplexElement.cs class, to see how I handle acquiring data from wrapped object.

Also consider possibility for real-time updates of data from backend. Your backend classes will need to implement INotifyPropertyChanged and in BlazorGenUI we need to listen for event. When data is changed in backend, event will fire up and we need to call StateHasChanged() to update UI. You can see on attached picture, currently implemented logic between updating data from source object (left) to UI (right).

reflection-update

Could you be maybe more specific?

Specter-13 avatar Apr 26 '21 07:04 Specter-13

I think that the current approach to support DTO objects should stay as is. Going to a more complicated scenarios will be very difficult

mynkow avatar Nov 05 '21 07:11 mynkow