Base solution for your next web application
Open Closed

Is there a Message Dto to transfer messages? #2222


User avatar
0
trendline created

My scenarios is delete a record in application service, the method defined in Application Service is 'DeleteItem', before do a delete action to entity, I need to return some messages to UI, such as,

1 It cannot be deleted, because something 2 It be deleted, the deleted identifier is xxx, the item name is xxx.

I knew there is a "UserFriendlyException" could throw exception to UI, but it will caused the network with 500 internal server error status.

Is there ABP provided a common message dto to transfer message?


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Sorry for the late response, I have missed your post somehow. Currently there is no class like that to provide what you are looking for.

  • User Avatar
    0
    trendline created

    This is a most common useful message transfer, I think ABP framework should provide one that like UserFriendlyException class done but without inherit from System.Exception

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can create an issue regarding to this request on github here <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues">https://github.com/aspnetboilerplate/as ... ate/issues</a>. We will consider it.

  • User Avatar
    0
    alex created

    I also have the exact same issue. I would like to use a more granular general return value than userfriendlyException. You might look at AjaxResponse object in ABP framework. I think that is what you mean. But I don't know what would be the side effect of using it in xAppService classes. Because ABP and Zero, do many things automatically.

  • User Avatar
    0
    trendline created

    <cite>Alex: </cite> I also have the exact same issue. I would like to use a more granular general return value than userfriendlyException. You might look at AjaxResponse object in ABP framework. I think that is what you mean. But I don't know what would be the side effect of using it in xAppService classes. Because ABP and Zero, do many things automatically.

    Yes, I had considered try to use AjaxResponse, but it is complex to extend it, it will impact ABP original more.