打开 关闭

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


User avatar
0
Analogon 创建
  • 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 答案
  • User Avatar
    0
    maliming 创建
    支持团队 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 三月 25, 2024, 15:11