Aller au contenu

Tag with (ARCH202)

Ce contenu n’est pas encore disponible dans votre langue.

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.

var orders = await _db.Orders
.Where(o => o.CustomerId == id)
.ToListAsync();
var orders = await _db.Orders
.TagWith("GetOrdersByCustomer")
.Where(o => o.CustomerId == id)
.ToListAsync();

Add a meaningful tag to queries with TagWith("...").