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

Add an OnError Event to the Blazor ViewModel #3279

Closed
mtavares628 opened this issue Mar 24, 2023 · 1 comment · Fixed by #3915
Closed

Add an OnError Event to the Blazor ViewModel #3279

mtavares628 opened this issue Mar 24, 2023 · 1 comment · Fixed by #3915
Assignees

Comments

@mtavares628
Copy link

Is your feature request related to a problem? Please describe.
I'd like to be able to react when a save fails and perform an action in my code when this happens. For example if a concurrency violation occurs during the save, I would like to pop up a modal and give the user an option to override the changes in the system or cancel them. While I'm currently doing this now with the ViewModelErrorText updating on the page, I don't see a way to trigger the modal when the ViewModelErrorText changes.

Describe the solution you'd like
I would like to see an Error event get invoked when an exception occurs during the save process. It could also be invoked when there is an error in the refresh as well.

Describe alternatives you've considered
I tried to potentially override the SaveAsync method on the ViewModel, but found myself rewriting the whole thing because I'm not able to set the Exception property in my inherited class, since it has a private setter.

@rockfordlhotka
Copy link
Member

Good suggestion, thanks!

rrrooommmaaa added a commit to rrrooommmaaa/csla that referenced this issue May 5, 2024
rockfordlhotka pushed a commit that referenced this issue May 6, 2024
* Add Error event in Blazor ViewModel (#3279)

* fix tests

* Error event provides Exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants