The json returned by abp has place holder for Error Message, but I am not sure how to send a Success Message. There are instances where I would like to send a customized success message.
Is there a way to handle it ?
Thanks, Partha
8 Answer(s)
-
0
Where? From controller or from app service? You can create a custom object that contains success properties and return it.
-
0
From App Service. yes I can create one , but I was thinking if it would be part of the framework that would be nice.
-
0
Hmmm.. nice idea. How we handle it in client side? Should show a UI notification or a messagebox?
-
0
I would prefer to be a notification rather being a message box
-
0
OK, but how to set this success message? Because error message is automatically set independent from your return value. In that case, we should return a specific type instead of simply our return type. We should think an elegant way of it.
-
0
If we can create a property like "Notification" or "UserMessage" if Success is true then Application layer can set the property and send it to the controller/ view to display it. Default message could be "The Transaction is successfully saved" so that I can always use this property to notify.
Let me know your thoughts
-
0
Hmm.. That's fine. I also thought similar. If app service (and controllers) have some List<Notification>, then we can fill it and automatically show on UI. This can be useful. I created an issue for it: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1003">https://github.com/aspnetboilerplate/as ... ssues/1003</a> Thanks.
-
0
Thank You for considering this. You are the best