Open Closed

How to throw BusinessException with message from repository (error unique index) #4239


User avatar
0
Analogon created
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"Create a record with a unique index with data than exists I get "internal error. I need to handle this error without having to check for its existence first. Because this is redundancy.

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can call the repository method to check for duplicates in the Domain service or Application service. This is the recommended practice.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09