Unfortunately, you cannot do this.
From the EF Core Documentation
EF Core does not support multiple concurrent operations performed in the same context instance. You should always wait for the operation to complete before the next operation begins. This is usually done using the await keyword for each asynchronous operation.
Also from the EF 6 documentation
Thread safety
While thread safety will make async more useful, it is an orthogonal function. It is not clear that we could implement support for it in the most general case, given that EF interacts with a schedule consisting of user code to maintain state, and there are no easy ways to ensure that this code is also thread safe.
At this point, EF will detect if the developer is trying to perform two async operations at a time and quit.
A DbContext only supports one open data reader at any given time. If you want to run multiple simultaneous database queries, you will need multiple instances of DbContext , one for each parallel query.
How often an error occurs is a condition of the race. Just because you start 2 jobs one after another (without waiting) does not guarantee that the database will be deleted at the same time. Sometimes the execution time occurs in the queue, and in other cases, one task can end immediately, as the other task starts, so there is no conflict.
How to avoid this - do not do this, as it is not supported. Expect each of the DbContext calls, or use multiple instances of DbContext.
by request I mean any DB operation, including SELECT, UPDATE, DELETE, INSERT, ALTER, STORED PROCEDURE CALL, ETC