let today = new Beginning();


Retry with exponetial back-off on C#

Just built a simple retry engine in C#. /// /// Retry engine. /// public class RetryEngine { private static Random rnd = new Random(); private readonly ILogger logger; /// /// Creates new retry engine. /// /// Logger public RetryEngine( …

C# .NET Retry

Build a common cache service for your C# app.

Recently, I found that almost every time I creates a new .NET app, I gonna need cache service. While Microsoft officially provides the IMemoryCache, I found that it is pretty complicated for you to use it. For it requires a lot of code. So I wrapped it to a more common one. Before starting, make sure the project references Microsoft.Extensions.Caching.Memory and Microsoft.Extensions.Logging. …

ASP.NET Core C# .NET Core Performance .NET Cache MemoryCache

Display code coverage information for .NET Core project using Azure DevOps.

Target. Display code coverage information on your own .NET Core project. First, create a build pipeline in your Azure DevOps. If you are using the classic designer, you need to add new .NET Core command line step. Make sure you publish the test result. As for the Arguments input, insert: --configuration $(buildConfiguration) --collect "Code coverage" Or if you are using YAML: Add …

.NET Core Azure DevOps .NET Test MSTest Integration Test Code coverage GitHub

How to serialize JSON object in C# without Newtonsoft Json

In many cases, we may not be able to access Newtonsoft.Json package. Like sometime there might be different packages using different versions of it, which may cause version conflict via build. That usually happens in some projects really large. So how can we play with JSON as while without it? In pure C#? First, copy the following class to your project: public static class MyJsonConverter { …

C# JSON .NET Newtonsoft.Json

  • 1