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

    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-rc.1. Updated on January 17, 2025, 14:13