Fire-and-forget tasks are easy to write and hard to operate. The call site returns, the request finishes, and the actual work continues somewhere with unclear ownership.

The dangerous part is failure. If the task throws, who observes the exception? Who logs it with the right correlation id? Who retries it? Who cancels it during shutdown? Who tells the user that the work did not happen?

For real application work, prefer an explicit background queue, hosted service, durable job, message bus, or workflow. That gives the work a lifecycle and a place for cancellation, retries, error handling, telemetry, and backpressure.

Small fire-and-forget work can still be acceptable for best-effort telemetry or non-critical cleanup, but make that decision visible. Catch and log exceptions inside the task, pass cancellation where possible, and avoid using scoped services after the request scope has ended.

The scoping trap usually looks like this:

// Dangerous: dbContext belongs to the HTTP request scope.
_ = Task.Run(async () =>
{
    dbContext.AuditLogs.Add(auditLog);
    await dbContext.SaveChangesAsync();
});

// Acceptable only for non-critical best-effort work.
_ = Task.Run(async () =>
{
    try
    {
        using var scope = serviceScopeFactory.CreateScope();
        var scopedDb =
            scope.ServiceProvider.GetRequiredService<AppDbContext>();

        scopedDb.AuditLogs.Add(auditLog);
        await scopedDb.SaveChangesAsync();
    }
    catch (Exception ex)
    {
        logger.LogError(ex, "Failed to write audit log in background.");
    }
});

The second version is not a replacement for a real queue. It only shows the minimum shape for best-effort work: create a fresh scope, resolve scoped services inside that scope, and observe exceptions inside the task. If the request scope’s DbContext is captured, the request can finish first and dispose the context while the background work is still running.

If the work matters to correctness, do not hide it behind _ = Task.Run(...). Make it a first-class part of the system.