The Wayback Machine - https://web.archive.org/web/20210408010517/https://github.com/dotnet/aspnetcore/issues/31604
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor: Record Type binding and validation for EditContext/EditForm #31604

Open
braidenstiller opened this issue Apr 8, 2021 · 0 comments
Open

Blazor: Record Type binding and validation for EditContext/EditForm #31604

braidenstiller opened this issue Apr 8, 2021 · 0 comments

Comments

@braidenstiller
Copy link

@braidenstiller braidenstiller commented Apr 8, 2021

Is your feature request related to a problem? Please describe.

Please consider binding and model validation in Blazor with record types. Currently when using the EditForm/EditContext it requires a model with mutable properties for input binding. Having the EditForm/EditContext bind to a record type and emit a new instance with modified state would allow for client-side functionality like state machines, state rewinding and fast-forwarding, mutation batching and other workflows which benefit from immutable state. This functionality and workflow would be similar to the MVC 5 record type binding which allows for form fields binding, field validation and model validation.

https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-5.0?view=aspnetcore-5.0

Describe the solution you'd like

A simple and idiomatic way to bind to record types similar to the current binding syntax. Understandably the current bind syntax may not be suitable as the field would have to emit a new record instance with the changes, then alert the EditForm/EditContext to update the bound Model property, or let the user handle it emit an event to propagate the changes up (or a combination of both).

@braidenstiller braidenstiller changed the title Blazor: Consider Record Type binding and validation for EditContext/EditForm Blazor: Record Type binding and validation for EditContext/EditForm Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant