Created
May 13, 2020 08:02
-
-
Save stijnmoreels/afc4335ef4c70006afaae6b4016b2305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string connectionString = "Server=sample-server;Database=sample-database;User=admin;Password=123"; | |
| using (var measurement = DependencyMeasurement.Start()) | |
| { | |
| // Interact with database | |
| var products = await _repository.GetProducts(); | |
| _logger.LogSqlDependency(connectionString, "my-table", "get-products", isSuccessful: true, measurement: measurement); | |
| // Output: "SQL Dependency sample-server for sample-database/my-table for operation get-products in 00:00:01.2396312 at 03/23/2020 09:32:02 +00:00 (Successful: True - Context: )" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment