Aperto Chiuso

Question regarding DeleteAsyc #7319


User avatar
0
Sergei.Gorlovetsky creato
  • ABP Framework version: v8.0
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Hello,

Is there any other efficient way to execute the DeleteAsync without running a select query (line 21 )

The task here is to soft delete the record for the given documentID FYI: documentID and primary key of the table is different. So I am running a select query (line 21) to fetch the records and passing the file.id after that.

But I am wondering somehow, I can maybe remove the extra select query before running DeleteAsync()


1 risposte
  • User Avatar
    0
    maliming creato
    Team di supporto Fullstack Developer

    hi

    There is no way to get a file without a select query.

    But you can consider executing a raw SQL to do this.

    https://learn.microsoft.com/en-us/ef/core/querying/sql-queries https://learn.microsoft.com/en-us/ef/core/saving/execute-insert-update-delete#executedelete

Made with ❤️ on ABP v8.2.0-preview Updated on marzo 25, 2024, 15:11