Using Problem Details in Asp.net Core
https://buildkite.com/blog/goodbye-integers-hello-uuids
UUIDv7
Kubernetes Debug Containers https://github.com/zinclabs/debug-container
Here is how to use AWS Text Extract to get data as keyvalue from the form Example usecase is to extrac key/value from W2 Tax form URL Textract documentation.
@inject IAmazonTextract TextractClient;
FileStream fileStream = new FileStream(uploadedFilePath, FileMode.Open, FileAccess.Read);
MemoryStream memoryStream = new MemoryStream();
await fileStream.CopyToAsync(memoryStream);
await fileStream.FlushAsync();
var analyzeDocumentRequest = new AnalyzeDocumentRequest()
{
Document = new Document { Bytes = memoryStream },
FeatureTypes = new List<string> { "FORMS" },
};
var analyzeDocumentResponse = await TextractClient.AnalyzeDocumentAsync(analyzeDocumentRequest);
keyValuePairs = analyzeDocumentResponse.GetKeyValuePairs();
Handling CancelKeyPress using a CancellationToken https://www.meziantou.net/detecting-console-closing-in-dotnet.htm
const int WaitIndefinitely = -1;
using var cts = new CancellationTokenSource();
Console.CancelKeyPress += (sender, e) =>
{
// We'll stop the process manually by using the CancellationToken
e.Cancel = true;
// Change the state of the CancellationToken to "Canceled"
// - Set the IsCancellationRequested property to true
// - Call the registered callbacks
cts.Cancel();
};
try
{
// code using the cancellation token
Console.WriteLine("Waiting");
await Task.Delay(WaitIndefinitely, cts.Token);
}
catch (OperationCanceledException)
{
Console.WriteLine("Operation canceled");
}
Console.WriteLine("Closing application...");