Niedawno musiałem zmierzyć się z budowaniem maili. Starym sposobem projektu było robienie tego w każdym miejscu, które wysyłało maila, tzn każdy projekt był właścicielem szablonu, a sam szablon był zdeployowany z kodem i wypełniany przez kod źródłowy string.Replace albo string.Format. Brzmi trochę creepy, prawda? To co z tym zrobić, żeby było uniwersalnie i bez jawnych …
Category: CSharp
AWS DynamoDB – 3 ways to query and read results in .NET
In my very first post, I showed how to use DynamoDB in .NET to receive single result (post). Looking into the evolution of API and layers of abstraction, we have much more options to query AWS DynamoDB. Therefore we have 3 ways to query and read results which I will demonstrate in this post. The …
HTTP Verbs in API design
HTTP Verbs are basic methods in web world. They are evolving between HTTP protocol versions but also new RFCs are published. Also they were extensions like WebDAV (with 7 methods). A full registry is maintained by IANA (here) however most of people will reply with 9 basic verbs (interesting discussion about this on stackoverflow). Why …
gRPC in .NET Core
As WCF is going to end of life with .NET 5.0 (more here), gRPC is going to replace it (as recommended alternative). So what’s that? It is bi-directional, HTTP/2 based protocol. It can be used to communicate server-server o client-server including scenarios like load-balancing, health checks, microservices communication. gRPC stands for Google RPC (Remote Procedure …
.NET MAUI – Xamarin.Forms successor
Today Microsoft announced .NET MAUI – a successor of Xamarin.Forms. Besides well known MVVM, .NET MAUI will use MVU (Model-Vue-Update) pattern. At first glance, the code will be much more readable (shorter) and closer to functional programming. Next milestone is single project for all types platforms. Right now, you need to have separate for iOS, …
SpecFlow – BDD in C# – induction
BDD – this acronym stand for Behavior Driven Development. This methology has been built using concepts of TDD (Test Driven Development) and DDD (Domain Driven Design). This type of tests is often done as integration tests (UI tests or API). One of the most popular libraries is SpecFlow. I was using this solution for Xamarin, …
Security Code Scan – open source vulnerability patterns detector
Security Code Scan is open source (LGPL v3.0) vulnerability patterns detector for C# (including .NET Core) and VB.NET. It has two installation modes: either as VS extension or as nuget package (SecurityCodeScan). Instead of writing about types of attacks which it can detect – let’s demo it. As a test application, I created API application …
Fluent Assertions in unit tests
As a continouation of the article about unit test frameworks I would like to introduce Fluent Assertions. This framework simplifies testing by BDD style syntax. Let’s start from basic assertion. As you noticed, first is going the result, then the keyword (or rather extension method) Should() and at the end the condition (so in case …
.NET unit test frameworks comparison
In .NET we have 3 dominant unit test frameworks: MS Test (v2) NUnit (3.x) xUnit (2.x) First one comes with Visual Studio, two other requires additional components installation. Initialize First difference we will find in initialization approach. In MS Test there several initialization available (by attributes): AssemblyInitialize, ClassInitialize and TestInitialize. The disadvantage is that initialization …
Install .NET Core on Debian Linux
Microsoft prepared quite good instruction how to install dotnet runtime on Linux. I’ve been interested in Debian distro. So I went pretty smooth through the first part of the manual (system setup). However installing dotnet I had constinously an error that package cannot be found. First comment: the package name has been changed and it …