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
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |
| <PropertyGroup> | |
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | |
| <Nullable>enable</Nullable> | |
| <ImplicitUsings>enable</ImplicitUsings> | |
| <FrameworkVersion>8.0.1</FrameworkVersion> | |
| </PropertyGroup> |
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
| public class ElapsedEnricher : ILogEventEnricher | |
| { | |
| public const string PropertyName = "Elapsed"; | |
| private readonly Stopwatch _stopwatch; | |
| public ElapsedEnricher() | |
| { | |
| _stopwatch = Stopwatch.StartNew(); | |
| } |
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
| /// <summary> | |
| /// Allows you to pass an asynchronous action that writes to the output stream. | |
| /// </summary> | |
| public class PushStreamContent : HttpContent | |
| { | |
| private readonly Func<Stream, Task> _writeToStreamAsync; | |
| private readonly int _length; | |
| /// <summary> | |
| /// Creates an instance of the PushStreamContent |