Avata Suljettu

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


User avatar
0
Analogon luotu
  • 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 Vastaus (t)
  • User Avatar
    0
    maliming luotu
    Tukitiimi 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 v8.2.0-preview Updated on maaliskuuta 25, 2024, 15.11