You can use Docker to push packages to a NuGet feed. This blog post shows how to release a NuGet package to Amazon CodeArtifact via Docker. Source code can be found at https://github.com/NikiforovAll/docker-release-container-sample.
The idea behind having a release container is pretty straightforward — you can bundle artifacts and tools so the release mechanism is portable and unified because of Docker. Also, another advantage of building NuGet packages in Docker is that you don’t need any dependencies installed on the build-server itself. I invite you to read Andrew’s Lock post to get more details about the use case ( https://andrewlock.net/pushing-nuget-packages-built-in-docker-by-running-the-container/)…
Concurrency with TPL is fairly simple. In this blog post, I will reiterate over fundamentals and share with you some common patterns that you could use to compose your solutions. This blog post is focused on the concurrent processing of a collection of tasks and possible semantics that could be considered during the design of a solution.
Examples and source code can be found here: nikiforovall.blog.examples/tap-composition
The Task class provides a life cycle for asynchronous operations, and that cycle is represented by the
TaskStatus enumeration. Exceptions occurring during the execution of an asynchronous method are assigned to the returned
We’ll focus on the extensibility points of the C# compiler to customize the behavior of async methods and task-like types. As result, we will be able to write linear, concise, and composable code with the possibility to have control over task scheduling. 🤓
I recommend reading the original blog post: https://nikiforovall.github.io/csharp/compcsi/dotnet/2020/10/20/awaitable-pattern.html
Numerous C# features are based on duck-typing and patterns inferred by the compiler. Basically, it means that a developer doesn’t need to implement interfaces or inherit classes explicitly to achieve some pluggable behavior. Instead, we could follow some well-known conventions inferred by the compiler to plug or glue some…
In this blog post, I would like to show you how easy is to publish your docker images to GitHub Container Registry. This topic is relevant because Docker Hub has changed retention limits, so might want to consider other players on the market.
To publish an image to ghcr:
To access GitHub container registry you need to create Personal Access Token (PAT) on GitHub:
“Settings > Developer Settings > Personal access tokens” and create token with permissions related to “packages” (or https://github.com/settings/tokens/new).
After that, you…
Quite often, in my day-to-day workflow, I want to wrap up some code sections in a well-known code snippet. I hate these moments. Usually, you want to cut and paste some code, and after that formatting goes wrong and all of that 😱. So…
I would like to share with you an extension for vscode that I wrote for personal use. (marketplace.visualstudio.com/surround-with-csharp) The goal of this extension is to provide the capability to wrap up selected text in a C# code snippet.
This extension supports different concepts to trigger functionally to surround your code.
Source code: https://github.com/NikiforovAll/surround-with-csharp
You can just…
I prefer reading books from cover to cover and taking notes quite frequently. At the same, I tend to have multiple items on my reading list. It feels frustrating to get back to an awesome book and realize I need to revision it all over again. So I decided to organize it a little bit. I think the best way to organize the learning process is to envision the end goal and have sensible timelines.
For the sake of simplicity, I use google spreadsheets as storage and XMind as a visualization tool. …
Introduction to System.IO.Pipelines. See Reference section for stuff you might find useful to delve in.
System.IO.Pipelines is a library that is designed to make it easier to do high-performance IO shipped in .NET Standard 2.1 as a first class BCL API.
Provides programming model to perform high-performance parsing of streaming data. Developers are free from having to manage buffers. A Pipeline is like a Stream that pushes data to you. Networking is the primary use case for this API, the whole thing emerged from Kestrel as an implementation detail.
There are no explicit buffers allocated. All buffer management is delegated…
I would share with you something fun. The right way to write interactive documentation — Try .NET. It is an awesome project maintained by Microsoft. It allows you to embed C# code inside your markdown documentation and run it locally. The absolute best way to learn it is to use it. So I encourage you to fork https://github.com/NikiforovAll/intro-to-algorithms and play with it.
All you need to do is to navigate to the root directory and run:
dotnet tool install -g dotnet-trydotnet try
On the demo below you can find an implementation of standard sorting algorithms with C# 8 and
Non-interactive version: https://github.com/NikiforovAll/intro-to-algorithms/blob/master/docs/Sorting.md
Originally published at https://nikiforovall.github.io.
Yes, you might say that blogging about design patterns is boring. But what about an interactive version with live examples and Try .NET? Let’s delve into it.
Defines a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. Strategy adapts behavior at runtime to requirements that are not known in advance.
In the general case, Pattern Strategy doesn’t restrict the number of operations in defined interface. So it could be one operation ( Sort in ISortable) or family of operations ( Encode/Decode in IMessageProcessor). In case when it…
It is a good time to be a .NET developer. It is not only mature and enterprise-ready ecosystem but vibrant and active community. I feel like guys from Microsoft doing a lot to support and encourage .NET community. In particular, that is why we have something like Windows Subsystem For Linux, Windows Terminal and many more.