Starts in:
2 DAYS
20 HRS
25 MIN
27 SEC
Starts in:
2 D
20 H
25 M
27 S
Open Closed

Check data if exist before insert/Update #752


User avatar
0
Leaf created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

What is the best way to check data is exist or not before insert/ update then if the data is exist then will show message box the data already exists.

Thank you.


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

    hi

    Use the repository to query data, you can throw a exception then the ui will automatically show the messages.

    https://docs.abp.io/en/abp/latest/Exception-Handling#business-exceptions https://docs.abp.io/en/abp/latest/Exception-Handling#user-friendly-exception

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