Tag with (ARCH202)
Key dotnet.ef.tag-with · Severity info · Category ef
To correlate generated SQL with its source in logs and profilers, queries should carry an annotation tag.
Incorrect
Section titled “Incorrect”var orders = await _db.Orders .Where(o => o.CustomerId == id) .ToListAsync();Correct
Section titled “Correct”var orders = await _db.Orders .TagWith("GetOrdersByCustomer") .Where(o => o.CustomerId == id) .ToListAsync();Add a meaningful tag to queries with TagWith("...").