OpenTelemetry .Net 6 Web Job
OpenTelemetry is the software industry standard for logging so I wrote a sample Web Job that logs, traces and emits metrics using open telemetry. Sample on Git Hub
Search for a command to run...
Articles tagged with #csharp
OpenTelemetry is the software industry standard for logging so I wrote a sample Web Job that logs, traces and emits metrics using open telemetry. Sample on Git Hub
To copy content folder in .csproj to output folder, add the following. <ItemGroup> <Content Include="$(ProjectDir)Content\**" CopyToOutputDirectory="PreserveNewest" /> </ItemGroup>
Suppose there are two async function GetX and GetY, then the code to get them to run in parallel and wait is. var tx = GetX(); var ty = GetY(); var results = await Task.WhenAll(tx,ty); var z = results[0] + results[1]; The type for the function is ...
Here is a trick I learned today on how to call methods defined on a model. Basically query the database for the fields in it and convert it to an Enumerable. You can then call the model methods Example: var allCoupons = responderCtx.Coupons .Whe...
Here is a sample code that shows how to check and create a Folder if needed. Process unread and incoming emails and categorize them into folders. https://github.com/xavierjohn/EmailCategorizationOutlookAddIn/blob/master/EmailCategorizationOutlookAddI...
The quickest way to delete is using a stored procedure. I prefer stored procedures in a database project over dynamic SQL because renames will be handled correctly and have compiler errors. Dynamic SQL could refer to tables that have been deleted/ren...