TagWith

Adds a tag (.TagWith) to the collection of tags associated with an EF LINQ query. Tags are query annotations that can provide contextual tracing information at different points in the query pipeline.

See in original class

public static async Task<List<Products>> GetProductsWithoutProjection(int categoryIdentifier)
                                {
                                    var productList = new List<Products>();
                                
                                    await Task.Run(async () =>
                                    {
                                        await using var context = new NorthwindContext();
                                
                                        productList = await context.Products
                                            .Include(product => product.Supplier)
                                            .Where(product => product.CategoryId == categoryIdentifier)
                                            .TagWith($"From: {nameof(DataOperations)}.{nameof(GetProductsWithoutProjection)} by Karen Payne for teaching")
                                            .ToListAsync();
                                
                                    });
                                
                                    return productList;
                                }

See also