Coding Militia https://blog.codingmilitia.com/ Recent content on Coding Militia Coding Militia https://blog.codingmilitia.com/logo.png https://blog.codingmilitia.com/logo.png Hugo -- 0.147.0 en-us Sun, 15 Feb 2026 17:00:00 +0000 Sometimes it's just better to load "all" the data https://blog.codingmilitia.com/2026/02/15/sometimes-its-just-better-to-load-all-the-data/ Sun, 15 Feb 2026 17:00:00 +0000 https://blog.codingmilitia.com/2026/02/15/sometimes-its-just-better-to-load-all-the-data/ A quick post on adapting your approach to the problem at hand, not just following the same ideas indiscriminately. On professionalism, professional pride, career and ambition https://blog.codingmilitia.com/2026/01/21/on-professionalism-professional-pride-career-and-ambition/ Wed, 21 Jan 2026 19:25:00 +0000 https://blog.codingmilitia.com/2026/01/21/on-professionalism-professional-pride-career-and-ambition/ An half-rant, half-reflection on the importance of professionalism, taking pride in one&rsquo;s work, and the role of ambition in career growth. Adopting Problem Details for HTTP APIs https://blog.codingmilitia.com/2025/07/15/adopting-problem-details-for-http-apis/ Tue, 15 Jul 2025 15:00:00 +0100 https://blog.codingmilitia.com/2025/07/15/adopting-problem-details-for-http-apis/ Time for a quick post about Problem Details, and how we adopted it at work, in a way that&rsquo;s actually useful. How I've been building APIs and microservices lately (feat. C# & .NET) https://blog.codingmilitia.com/2025/06/11/how-ive-been-building-apis-and-microservices-lately-feat-csharp-dotnet/ Wed, 11 Jun 2025 08:30:00 +0100 https://blog.codingmilitia.com/2025/06/11/how-ive-been-building-apis-and-microservices-lately-feat-csharp-dotnet/ This post is all about how I&rsquo;ve been building APIs and microservices lately (using .NET and C#), what&rsquo;s been making me productive, and how my approach has evolved over time. Kubernetes API powered resource discovery (feat. K8s C# client) https://blog.codingmilitia.com/2025/04/27/kubernetes-api-powered-resource-discovery/ Sun, 27 Apr 2025 19:40:00 +0100 https://blog.codingmilitia.com/2025/04/27/kubernetes-api-powered-resource-discovery/ Have you ever felt the need to automate the discovery of some information within a distributed system? Turns out, the Kubernetes API makes it surprisingly simple to do so. Care about the domain, not about implementing all the patterns and principles under the sun https://blog.codingmilitia.com/2024/12/16/care-about-the-domain-not-about-implementing-all-the-patterns-and-principles-under-the-sun/ Mon, 16 Dec 2024 19:20:00 +0000 https://blog.codingmilitia.com/2024/12/16/care-about-the-domain-not-about-implementing-all-the-patterns-and-principles-under-the-sun/ Time again for a rant adjacent post, on this occasion, about building applications following some domain-driven design ideas. Introducing OutboxKit https://blog.codingmilitia.com/2024/12/03/introducing-outboxkit/ Tue, 03 Dec 2024 08:45:00 +0000 https://blog.codingmilitia.com/2024/12/03/introducing-outboxkit/ After talking about the outbox pattern so much, and implementing it from scratch a few times in a few different projects, finally figured it was high time for me to build something I could reuse. Keeping an eye on cache hit ratio (feat. FusionCache, OpenTelemetry & friends) https://blog.codingmilitia.com/2024/11/17/keeping-an-eye-on-cache-effectiveness-feat-fusioncache-opentelemetry/ Sun, 17 Nov 2024 18:15:00 +0000 https://blog.codingmilitia.com/2024/11/17/keeping-an-eye-on-cache-effectiveness-feat-fusioncache-opentelemetry/ In this post, we&rsquo;ll take a very quick look at how to use the awesome FusionCache library, and how to observe its impact on our services. Testcontainers and Podman https://blog.codingmilitia.com/2024/11/02/testcontainers-and-podman/ Sat, 02 Nov 2024 21:45:00 +0000 https://blog.codingmilitia.com/2024/11/02/testcontainers-and-podman/ Spent way too much time trying to get Testcontainers to work with Podman, to find out I just needed to set a flag šŸ™ƒ. Transactional outbox pattern meets distributed tracing and OpenTelemetry https://blog.codingmilitia.com/2024/06/17/transactional-outbox-pattern-meets-distributed-tracing-and-opentelemetry/ Mon, 17 Jun 2024 09:00:00 +0100 https://blog.codingmilitia.com/2024/06/17/transactional-outbox-pattern-meets-distributed-tracing-and-opentelemetry/ Transactional outbox pattern and distributed tracing doesn&rsquo;t seem like having much in common, right? This post describes how they intersect and a possible approach to get them working together nicely. Where are my traces? (weird .NET meets OpenTelemetry gotcha) https://blog.codingmilitia.com/2024/05/13/where-are-my-traces-weird-dotnet-meets-opentelemetry-gotcha/ Mon, 13 May 2024 08:55:00 +0100 https://blog.codingmilitia.com/2024/05/13/where-are-my-traces-weird-dotnet-meets-opentelemetry-gotcha/ Quick post about a weird gotcha I found when using distributed tracing with OpenTelemetry .NET, in a system where not all services have otel setup Primitive vs strongly typed dictionary keys (feat. frozen collections and BenchmarkDotNet) https://blog.codingmilitia.com/2024/04/13/primitive-vs-strongly-typed-dictionary-keys-feat-frozen-collections-and-benchmarkdotnet/ Sat, 13 Apr 2024 17:00:00 +0100 https://blog.codingmilitia.com/2024/04/13/primitive-vs-strongly-typed-dictionary-keys-feat-frozen-collections-and-benchmarkdotnet/ Quick post comparing the usage of different types as dictionary keys, including using custom types instead of only primitive types. A .NET parallel Kafka consumer proof of concept (feat. Akka.NET and the actor model) https://blog.codingmilitia.com/2024/01/08/a-dotnet-parallel-kafka-consumer-proof-of-concept-feat-akkadotnet-and-the-actor-model/ Mon, 08 Jan 2024 19:00:00 +0000 https://blog.codingmilitia.com/2024/01/08/a-dotnet-parallel-kafka-consumer-proof-of-concept-feat-akkadotnet-and-the-actor-model/ For some time now, I&rsquo;ve been thinking about implementing a parallel Kafka consumer proof of concept in C#. I finally got around to it, and this post describes the process. Byte array as a dictionary key? Trying out some options https://blog.codingmilitia.com/2023/12/06/byte-array-as-a-dictionary-key-trying-out-some-options/ Wed, 06 Dec 2023 13:30:00 +0000 https://blog.codingmilitia.com/2023/12/06/byte-array-as-a-dictionary-key-trying-out-some-options/ Using arrays as a dictionary key is not really something very common, but I had the need for it, so did some investigation to try and figure out a good way to do it. Observing .NET microservices with OpenTelemetry - logs, traces and metrics https://blog.codingmilitia.com/2023/09/05/observing-dotnet-microservices-with-opentelemetry-logs-traces-metrics/ Tue, 05 Sep 2023 08:10:00 +0100 https://blog.codingmilitia.com/2023/09/05/observing-dotnet-microservices-with-opentelemetry-logs-traces-metrics/ Observability has been one of the hot topics, with the increasing complexity of knowing what is going on in our applications. Fortunately, .NET has been investing in making things easier with OpenTelemetry. "Parse, don't validate" and other type safety driven shenanigans (plus a C# wishlist) https://blog.codingmilitia.com/2023/08/17/parse-dont-validate-and-other-type-safety-driven-shenanigans-plus-a-csharp-wishlist/ Thu, 17 Aug 2023 09:00:00 +0100 https://blog.codingmilitia.com/2023/08/17/parse-dont-validate-and-other-type-safety-driven-shenanigans-plus-a-csharp-wishlist/ Making use of the type system is something I feel should be important when working in a strongly typed language like C#. However, I don&rsquo;t feel like that&rsquo;s the case, and I would love for the language to push folks in the direction of creating more robust programs, where the compiler provides more help in proving the correctness of the code. Enforce conventions (but don't go overboard) with architecture tests https://blog.codingmilitia.com/2023/07/28/enforce-conventions-but-dont-go-overboard-with-architecture-tests/ Fri, 28 Jul 2023 08:45:00 +0100 https://blog.codingmilitia.com/2023/07/28/enforce-conventions-but-dont-go-overboard-with-architecture-tests/ I&rsquo;ve been trying to flee the over-engineered C# solution structures, with multiple projects, with related code scattered around. Even if an imperfect solution, I&rsquo;ve turned to NetArchTest to help in guide on following some conventions in a simplified solution structure. From domain events to infrastructure - thinking out loud about possible approaches I don’t hate https://blog.codingmilitia.com/2023/05/16/from-domain-events-to-infrastructure-thinking-out-loud-about-possible-approaches-i-dont-hate/ Tue, 16 May 2023 08:20:00 +0100 https://blog.codingmilitia.com/2023/05/16/from-domain-events-to-infrastructure-thinking-out-loud-about-possible-approaches-i-dont-hate/ On the topics of domain-driven design and event-driven architecture, something that’s been on my mind for quite some time, is the process of handling domain events, as well as potentially translating them into integration events. Checking out EF Core inheritance options https://blog.codingmilitia.com/2023/05/08/checking-out-ef-core-inheritance-options/ Mon, 08 May 2023 08:25:00 +0100 https://blog.codingmilitia.com/2023/05/08/checking-out-ef-core-inheritance-options/ Recently there was a need to use a hierarchy in a domain model, and there was a question about which of the available approaches to use - table per hierarchy (TPH), table per type (TPT) or table per concrete type (TPC). This very brief post is just a quick look at some benchmarks I created on the subject. A reminder to consider that your context, isn’t the only context (.NET 8 TimeProvider edition) https://blog.codingmilitia.com/2023/04/24/a-reminder-that-your-context-isnt-the-only-context-dotnet8-timeprovider-edition/ Mon, 24 Apr 2023 08:45:00 +0100 https://blog.codingmilitia.com/2023/04/24/a-reminder-that-your-context-isnt-the-only-context-dotnet8-timeprovider-edition/ This will be a very brief post, just as a reminder that we need to give things a good thought, trying to limit our biases (I’ll focus on software development, but it’s applicable to everything really). Contract first OpenAPI development (but still use Swagger UI with ASP.NET Core) https://blog.codingmilitia.com/2023/04/02/contract-first-openapi-development-but-still-use-swagger-ui-with-asp.net-core/ Sun, 02 Apr 2023 19:45:00 +0100 https://blog.codingmilitia.com/2023/04/02/contract-first-openapi-development-but-still-use-swagger-ui-with-asp.net-core/ In C# and .NET land, we&rsquo;re pretty heavy on the code first approaches, with the odd exception. Let&rsquo;s take a look at a possible contract first approach to API development, with OpenAPI, but still taking advantage of existing tooling that we&rsquo;ve come to rely on, like Swagger UI. Mapping ASP.NET Core minimal API endpoints with C# source generators https://blog.codingmilitia.com/2023/01/31/mapping-aspnet-core-minimal-api-endpoints-with-csharp-source-generators/ Tue, 31 Jan 2023 17:30:00 +0000 https://blog.codingmilitia.com/2023/01/31/mapping-aspnet-core-minimal-api-endpoints-with-csharp-source-generators/ I’m pretty late to the C# source generator party, but hey, better late than never šŸ˜…. In this post, let&rsquo;s take a look at how we can automagically map minimal API endpoints using C# source generators The ā€œinsert specific tech hereā€ developer: yay or nay? https://blog.codingmilitia.com/2023/01/19/the-insert-specific-tech-here-developer-yay-or-nay/ Thu, 19 Jan 2023 17:30:00 +0000 https://blog.codingmilitia.com/2023/01/19/the-insert-specific-tech-here-developer-yay-or-nay/ The boxes developers put themselves into is something I&rsquo;ve given some thought over time. Probably not something folks think about much, but figured I&rsquo;d write a post about it anyway. On rĆ©sumĆ©-driven development, FOMO and dismissing it https://blog.codingmilitia.com/2022/11/07/on-resume-driven-development-fomo-and-dismissing-it/ Mon, 07 Nov 2022 17:55:00 +0000 https://blog.codingmilitia.com/2022/11/07/on-resume-driven-development-fomo-and-dismissing-it/ I&rsquo;ve had some of thoughts not exactly rĆ©sumĆ©-driven development, but more importantly, how engineers, can remain up to date and relevant in the job market, and a recent discussion on LinkedIn reminded me about it. Beware of records, with expressions and calculated properties https://blog.codingmilitia.com/2022/09/01/beware-of-records-with-expressions-and-calculated-properties/ Thu, 01 Sep 2022 18:30:00 +0100 https://blog.codingmilitia.com/2022/09/01/beware-of-records-with-expressions-and-calculated-properties/ I’ve been using C# records a lot since the feature was introduced. However, when using them, we really need to understand how they work, otherwise we might face unexpected surprises. [Video] Outbox meets change data capture - hooking into the Write-Ahead Log (feat. .NET, PostgreSQL & Kafka) https://blog.codingmilitia.com/2022/07/27/outbox-meets-change-data-capture-hooking-into-the-write-ahead-log/ Wed, 27 Jul 2022 19:45:00 +0100 https://blog.codingmilitia.com/2022/07/27/outbox-meets-change-data-capture-hooking-into-the-write-ahead-log/ Another video on using change data capture (often referred to as CDC), to hook up into the database transaction log, forwarding incoming entries to the outbox table. [Video] What's the point of async/await in an ASP.NET Core application? https://blog.codingmilitia.com/2022/05/30/whats-the-point-of-async-await-in-an-aspnetcore-application/ Mon, 30 May 2022 18:00:00 +0100 https://blog.codingmilitia.com/2022/05/30/whats-the-point-of-async-await-in-an-aspnetcore-application/ I&rsquo;ve been noticing in recent chats that folks have difficulty explaining why do we use async/await, tasks and related, when building ASP.NET Core applications. [Video] Quick shout-out to DevToys https://blog.codingmilitia.com/2022/05/03/quick-shout-out-to-devtoys/ Tue, 03 May 2022 17:50:00 +0100 https://blog.codingmilitia.com/2022/05/03/quick-shout-out-to-devtoys/ Wanted to very briefly share a tool I&rsquo;ve come across a couple of months ago: DevToys. [Video] Polymorphic JSON Serialization (feat. .NET & System.Text.Json) https://blog.codingmilitia.com/2022/04/13/polymorphic-json-serialization-feat-dotnet-system-text-json/ Wed, 13 Apr 2022 19:45:00 +0100 https://blog.codingmilitia.com/2022/04/13/polymorphic-json-serialization-feat-dotnet-system-text-json/ Time for one more video on messing with System.Text.Json, this time to get polymorphic (de)serialization going. OpenAPI extensions and Swashbuckle https://blog.codingmilitia.com/2022/02/21/openapi-extensions-and-swashbuckle/ Mon, 21 Feb 2022 17:25:00 +0000 https://blog.codingmilitia.com/2022/02/21/openapi-extensions-and-swashbuckle/ Let’s take a quick look at OpenAPI extensions (which I discovered were a thing last week šŸ˜›) and how to add them to our API description using ASP.NET Core and Swashbuckle. Array or object JSON deserialization (feat. .NET & System.Text.Json) https://blog.codingmilitia.com/2022/01/31/array-or-object-deserialization/ Mon, 31 Jan 2022 17:25:00 +0000 https://blog.codingmilitia.com/2022/01/31/array-or-object-deserialization/ Ah, the joys of integrating with third-party APIs&hellip; We always end up having to hammer something to get things working 🤣. This is a post about one of such situations, resorting to some JSON deserialization trickery (via JsonConverter) to be able to get things working. [Video] Outbox meets change data capture (feat. .NET, PostgreSQL, Kafka and Debezium) https://blog.codingmilitia.com/2022/01/17/outbox-meets-change-data-capture-feat-dotnet-postgresql-kafka-debezium/ Mon, 17 Jan 2022 17:30:00 +0000 https://blog.codingmilitia.com/2022/01/17/outbox-meets-change-data-capture-feat-dotnet-postgresql-kafka-debezium/ Quick video with an interesting approach to implement the publisher part of the outbox pattern. Using change data capture (often referred to as CDC), we hook up something to the database transaction log, forwarding incoming entries to the outbox table. In this example, we&rsquo;ll make use of Debezium, hooked up into a PostgreSQL database, forwarding messages to Kafka. Getting a complex type as a simple type from the query string in a ASP.NET Core API controller https://blog.codingmilitia.com/2022/01/03/getting-complex-type-as-simple-type-query-string-aspnet-core-api-controller/ Mon, 03 Jan 2022 18:00:00 +0000 https://blog.codingmilitia.com/2022/01/03/getting-complex-type-as-simple-type-query-string-aspnet-core-api-controller/ This is a tale of a good amount of hours of wasted time, so I’m going to document it so I remember it in the future. The idea is simple: when building an API, how can we treat a complex type as a simple type, to avoid things like primitive obsession, implement strongly typed ids and other related patterns? Let&rsquo;s find out! šŸ™‚ [Video] Checking out NDepend https://blog.codingmilitia.com/2021/12/06/checking-out-ndepend/ Mon, 06 Dec 2021 17:15:00 +0000 https://blog.codingmilitia.com/2021/12/06/checking-out-ndepend/ Let&rsquo;s take a look at something that&rsquo;s been around for years, but maybe flew under the radar: NDepend, a static code analysis tool tailored for .NET. [Video] High-performance and compile-time logging source generation in .NET 6 https://blog.codingmilitia.com/2021/11/21/high-performance-and-compile-time-source-generation-dotnet-6/ Sun, 21 Nov 2021 16:30:00 +0000 https://blog.codingmilitia.com/2021/11/21/high-performance-and-compile-time-source-generation-dotnet-6/ Quick little video about an interesting new logging related feature coming in .NET 6, compile-time logging source generation, as well as related high-performance logging features, which were already present but probably not very well known. [Video] Exploring distributed tracing with ASP NET Core 6 https://blog.codingmilitia.com/2021/10/26/exploring-distributed-tracing-with-aspnet-core-6/ Tue, 26 Oct 2021 18:45:00 +0100 https://blog.codingmilitia.com/2021/10/26/exploring-distributed-tracing-with-aspnet-core-6/ Distributed tracing isn&rsquo;t a new subject by any means, but there are some more recent developments, namely in terms of standards like W3C Trace Context and OpenTelemetry, that are worth a look. [Video] Are ASP.NET Core Minimal APIs just for demos? https://blog.codingmilitia.com/2021/08/17/are-aspnet-core-6-minimal-apis-just-for-demos/ Tue, 17 Aug 2021 17:45:00 +0100 https://blog.codingmilitia.com/2021/08/17/are-aspnet-core-6-minimal-apis-just-for-demos/ The upcoming release of ASP.NET Core 6 brings a pretty interesting feature set referred to as &ldquo;Minimal APIs&rdquo;. While they seem pretty interesting to me and many others, some folks are not fans and can be quite vocal about it, so I thought about taking quick look, put things in perspective, as well as compare with other tech stacks. Next level console apps with Spectre.Console https://blog.codingmilitia.com/2021/07/27/next-level-console-apps-with-spectre-console/ Tue, 27 Jul 2021 19:15:00 +0100 https://blog.codingmilitia.com/2021/07/27/next-level-console-apps-with-spectre-console/ Don&rsquo;t know about you, but when I build console applications, pretty is not a word I use to describe them. Let&rsquo;s see how Spectre.Console can help us with that! Mistaking software for a finished product https://blog.codingmilitia.com/2021/05/10/mistaking-software-for-a-finished-product/ Mon, 10 May 2021 18:30:00 +0100 https://blog.codingmilitia.com/2021/05/10/mistaking-software-for-a-finished-product/ As much as it would be simpler, software isn&rsquo;t something we can ship and forget about, or even just keep adding features without revisiting architecture and design. Virtual as a code smell* https://blog.codingmilitia.com/2021/04/07/virtual-as-a-code-smell/ Wed, 07 Apr 2021 18:45:00 +0100 https://blog.codingmilitia.com/2021/04/07/virtual-as-a-code-smell/ Lately I noticed I&rsquo;m essentially treating virtual methods as a code smell, so thought it could result in an interesting blog post. Setting up demos in Azure - Part 2: GitHub Actions https://blog.codingmilitia.com/2021/03/14/setting-up-demos-in-azure-part-2-github-actions/ Sun, 14 Mar 2021 16:00:00 +0100 https://blog.codingmilitia.com/2021/03/14/setting-up-demos-in-azure-part-2-github-actions/ Building on the work from the previous post, in this one we make use of GitHub Actions to setup workflows for easy setup and tear down of a demo environment in Azure. Setting up demos in Azure - Part 1: ARM templates https://blog.codingmilitia.com/2021/03/07/setting-up-demos-in-azure-part-1-arm-templates/ Sun, 07 Mar 2021 10:30:00 +0100 https://blog.codingmilitia.com/2021/03/07/setting-up-demos-in-azure-part-1-arm-templates/ As I&rsquo;m preparing some demos using Azure services, wanted to have things in place so I can easily setup the whole environment. In this first part, we look at using Azure Resource Manager (ARM) templates to get all those services up and running. Streamlining package versioning with MinVer https://blog.codingmilitia.com/2021/01/24/streamlining-package-versioning-with-minver/ Sun, 24 Jan 2021 16:00:00 +0100 https://blog.codingmilitia.com/2021/01/24/streamlining-package-versioning-with-minver/ In the past two posts on the path to publish a NuGet package, we started by setting up the build with NUKE and running it with GitHub Actions. Before we get to the actual publishing part, there&rsquo;s one more thing we need, which is to handle versioning. Getting started with GitHub Actions https://blog.codingmilitia.com/2020/12/22/getting-started-with-github-actions/ Tue, 22 Dec 2020 18:30:00 +0100 https://blog.codingmilitia.com/2020/12/22/getting-started-with-github-actions/ In a previous post, we started to prepare the build pipeline for a new library, using NUKE. In this post, we&rsquo;re going to continue that work, setting up continuous integration, running the build with GitHub Actions when changes arrive. Going all-in with nullable reference types https://blog.codingmilitia.com/2020/11/28/going-all-in-with-nullable-reference-types/ Sat, 28 Nov 2020 11:00:00 +0100 https://blog.codingmilitia.com/2020/11/28/going-all-in-with-nullable-reference-types/ I know I&rsquo;m late to the party, but just recently had the opportunity to start using nullable reference types more seriously, so thought of gathering the first steps taken to go all-in with it. .NET Conf 2020 and .NET 5 links https://blog.codingmilitia.com/2020/11/15/dotnet-conf-2020-and-dotnet-5-links/ Sun, 15 Nov 2020 12:30:00 +0100 https://blog.codingmilitia.com/2020/11/15/dotnet-conf-2020-and-dotnet-5-links/ .NET Conf 2020 is done and .NET 5 is finally here! Information about this release is spread across a bunch of blogs, videos and whatnot, so I thought of grabbing a bunch of links and put them in a post for quick reference. Setting up a build with NUKE https://blog.codingmilitia.com/2020/10/24/2020-10-24-setting-up-a-build-with-nuke/ Sat, 24 Oct 2020 19:00:00 +0100 https://blog.codingmilitia.com/2020/10/24/2020-10-24-setting-up-a-build-with-nuke/ Let&rsquo;s take a look at NUKE, a cross-platform build automation system with C# DSL. We&rsquo;ll use it to define the build for a new library that will eventually make its way to NuGet. Shaking things up a bit - ASPF02O Outro https://blog.codingmilitia.com/2020/09/21/shaking-things-up-a-bit-aspf02o-outro/ Mon, 21 Sep 2020 11:00:00 +0100 https://blog.codingmilitia.com/2020/09/21/shaking-things-up-a-bit-aspf02o-outro/ Almost two years have passed since I started the &ldquo;ASP.NET Core: From 0 to Overkill&rdquo; series. It&rsquo;s time to shake things up a bit šŸ™‚. Some comments, tips and rants about my path to Kubernetes certification https://blog.codingmilitia.com/2020/09/07/some-comments-tips-rants-about-my-path-to-kubernetes-certification-ckad/ Mon, 07 Sep 2020 18:30:00 +0100 https://blog.codingmilitia.com/2020/09/07/some-comments-tips-rants-about-my-path-to-kubernetes-certification-ckad/ Sharing my experience about my path to learn about Kubernetes and prepare for the Certified Kubernetes Application Developer (CKAD) exam. Event-driven integration #6 - Publishing events (feat. Apache Kafka) [ASPF02O|E045] https://blog.codingmilitia.com/2020/08/18/aspnet-045-from-zero-to-overkill-event-driven-integration-06-publishing-events-feat-apache-kafka/ Tue, 18 Aug 2020 11:00:00 +0100 https://blog.codingmilitia.com/2020/08/18/aspnet-045-from-zero-to-overkill-event-driven-integration-06-publishing-events-feat-apache-kafka/ In this episode, we implement event publishing to Apache Kafka from the auth service, making use of Confluent&rsquo;s .NET client package. Microservices and correctly built distributed systems https://blog.codingmilitia.com/2020/07/15/microservices-and-correctly-built-distributed-systems/ Wed, 15 Jul 2020 18:30:00 +0100 https://blog.codingmilitia.com/2020/07/15/microservices-and-correctly-built-distributed-systems/ Microservices are all the rage for some time now, but are we using the right foundations to create them? In this post, we&rsquo;ll look into a common design issue in distributed systems. Event-driven integration #5 - Quick intro to Apache Kafka [ASPF02O|E044] https://blog.codingmilitia.com/2020/06/09/aspnet-044-from-zero-to-overkill-event-driven-integration-05-quick-intro-to-apache-kafka/ Tue, 09 Jun 2020 18:30:00 +0100 https://blog.codingmilitia.com/2020/06/09/aspnet-044-from-zero-to-overkill-event-driven-integration-05-quick-intro-to-apache-kafka/ In this episode, we briefly introduce Apache Kafka, as we&rsquo;ll use it to implement our event bus. We&rsquo;ll focus on our specific use case, as Kafka can be used in a variety of scenarios. We&rsquo;ll keep it in a developer&rsquo;s perspective, not going much into more infrastructural subjects. Event-driven integration #4 - Outbox publisher (feat. IHostedService & Channels) [ASPF02O|E043] https://blog.codingmilitia.com/2020/05/07/aspnet-043-from-zero-to-overkill-event-driven-integration-04-outbox-publisher-feat-ihostedservice-channels/ Thu, 07 May 2020 10:30:00 +0100 https://blog.codingmilitia.com/2020/05/07/aspnet-043-from-zero-to-overkill-event-driven-integration-04-outbox-publisher-feat-ihostedservice-channels/ In this episode, we&rsquo;ll implement the outbox publisher, or better yet, two versions of it, one better suited for lower latency and another for reliability. As we continue our event-driven path, this will be a good opportunity to introduce a couple of interesting .NET Core features: IHostedService (and BackgroundService) and System.Threading.Channels. Event-driven integration #3 - Storing events in the outbox table [ASPF02O|E042] https://blog.codingmilitia.com/2020/04/28/aspnet-042-from-zero-to-overkill-event-driven-integration-03-storing-events-in-the-outbox-table/ Tue, 28 Apr 2020 17:30:00 +0100 https://blog.codingmilitia.com/2020/04/28/aspnet-042-from-zero-to-overkill-event-driven-integration-03-storing-events-in-the-outbox-table/ On the footsteps of the last episode, in this one we store the inferred events in the outbox table, doing so transactionally, so we have guarantees that any change will eventually result in a published event. Event-driven integration #2 - Inferring events from EF Core changes [ASPF02O|E041] https://blog.codingmilitia.com/2020/04/20/aspnet-041-from-zero-to-overkill-event-driven-integration-inferring-events-from-efcore-changes/ Mon, 20 Apr 2020 18:00:00 +0100 https://blog.codingmilitia.com/2020/04/20/aspnet-041-from-zero-to-overkill-event-driven-integration-inferring-events-from-efcore-changes/ In this first step implementing event-driven integration between services, we&rsquo;ll hook-up into EF Core&rsquo;s infrastructure, namely when saving changes, to infer if any event should be raised based on the information provided by the change tracker. Event-driven integration #1 - Intro to the transactional outbox pattern [ASPF02O|E040] https://blog.codingmilitia.com/2020/04/13/aspnet-040-from-zero-to-overkill-event-driven-integration-transactional-outbox-pattern/ Mon, 13 Apr 2020 17:30:00 +0100 https://blog.codingmilitia.com/2020/04/13/aspnet-040-from-zero-to-overkill-event-driven-integration-transactional-outbox-pattern/ As we start implementing event-driven integration, the first thing we need to do is publish the events. Although it might seem straightforward, there are some important things to consider in order to make it work reliably. In this episode, we discuss the challenges and introduce the transactional outbox pattern to help us facing these challenges. Event-driven integration - Overview [ASPF02O|E039] https://blog.codingmilitia.com/2020/04/05/aspnet-039-from-zero-to-overkill-event-driven-integration-overview/ Sun, 05 Apr 2020 11:30:00 +0100 https://blog.codingmilitia.com/2020/04/05/aspnet-039-from-zero-to-overkill-event-driven-integration-overview/ In this episode, we take a look at the integration problem we have between services right now, go through some options to avoid or fix it, then have a quick overview of the solution we&rsquo;ll be implementing in the coming episodes. More explicit domain error handling and fewer exceptions with Either and Error types [ASPF02O|E038] https://blog.codingmilitia.com/2020/03/02/aspnet-038-from-zero-to-overkill-more-explicit-error-handling-with-either/ Mon, 02 Mar 2020 18:30:00 +0000 https://blog.codingmilitia.com/2020/03/02/aspnet-038-from-zero-to-overkill-more-explicit-error-handling-with-either/ Following up on the last episode about the Optional type, we continue taking inspiration from functional languages and introduce Either and Error types, as a way to make the possible business logic outcomes more explicit and minimize using exceptions in non-exceptional situations. Better use of types - avoiding nulls with an Optional type [ASPF02O|E037] https://blog.codingmilitia.com/2020/02/17/aspnet-037-from-zero-to-overkill-better-use-of-types-avoiding-nulls-with-optional-type/ Mon, 17 Feb 2020 18:00:00 +0000 https://blog.codingmilitia.com/2020/02/17/aspnet-037-from-zero-to-overkill-better-use-of-types-avoiding-nulls-with-optional-type/ In this post, we&rsquo;ll make use of a concept most commonly associated with functional programming, the Optional type (aka Option or Maybe), in order to make our code safer and more explicit when expressing a lack of value, instead of leaning on the null reference, something that I&rsquo;m sure has burned us many times in the past. E036 - Making things more object oriented with rich domain entities - ASPF02O https://blog.codingmilitia.com/2020/02/06/aspnet-036-from-zero-to-overkill-making-things-more-object-oriented-with-rich-domain-entities/ Thu, 06 Feb 2020 19:30:00 +0000 https://blog.codingmilitia.com/2020/02/06/aspnet-036-from-zero-to-overkill-making-things-more-object-oriented-with-rich-domain-entities/ In this episode, we&rsquo;ll make things more object oriented, by moving some logic that&rsquo;s present in the request handlers, which in fact should be present in the domain entities, that currently are just bags of data with public getters and setters. A look at Building the Future 2020 https://blog.codingmilitia.com/2020/02/04/a-look-at-building-the-future-2020/ Tue, 04 Feb 2020 18:45:00 +0000 https://blog.codingmilitia.com/2020/02/04/a-look-at-building-the-future-2020/ This past week I had the opportunity to attend Building the Future 2020, an event focused on digital transformation, so I thought about sharing some of the main topics that stuck with me. E035 - Experimenting with (yet) another approach to data access organization - ASPF02O https://blog.codingmilitia.com/2020/01/20/aspnet-035-from-zero-to-overkill-experimenting-with-yet-another-approach-to-data-access-organization/ Mon, 20 Jan 2020 19:00:00 +0000 https://blog.codingmilitia.com/2020/01/20/aspnet-035-from-zero-to-overkill-experimenting-with-yet-another-approach-to-data-access-organization/ In this episode, we&rsquo;ll take a look at (yet) another approach to organizing data access code, very likely overkill. E034 - Segregating use cases with MediatR - ASPF02O https://blog.codingmilitia.com/2020/01/10/aspnet-034-from-zero-to-overkill-segregating-use-cases-with-mediatr/ Fri, 10 Jan 2020 18:25:00 +0000 https://blog.codingmilitia.com/2020/01/10/aspnet-034-from-zero-to-overkill-segregating-use-cases-with-mediatr/ In this episode, we&rsquo;ll take a look at segregating our application use cases in dedicated classes instead of shoving everything into the same service class. E033 - Redesigning the API: Improving the internal architecture - ASPF02O https://blog.codingmilitia.com/2019/12/20/aspnet-033-from-zero-to-overkill-redesigning-the-api-improving-the-internal-architecture/ Fri, 20 Dec 2019 18:25:00 +0000 https://blog.codingmilitia.com/2019/12/20/aspnet-033-from-zero-to-overkill-redesigning-the-api-improving-the-internal-architecture/ In this episode, we&rsquo;ll take a look at redesigning an API that has been developed in a traditional layered way, moving to a more interesting onion/hexagonal/ports and adapters architecture (which is apparently very fashionable right now in .NET land). Use POCOs to group data and logic - there's more to life than services and DTOs https://blog.codingmilitia.com/2019/12/10/use-pocos-to-group-data-and-logic/ Tue, 10 Dec 2019 20:00:00 +0000 https://blog.codingmilitia.com/2019/12/10/use-pocos-to-group-data-and-logic/ In C# land, the abuse of services and DTOs is prevalent. How about grouping data and behavior using POCOs? You know, ob)ect oriented stuff šŸ™‚. "Equals" and "==" are not... equal https://blog.codingmilitia.com/2019/12/01/equals-and-equals-are-not-equal/ Sun, 01 Dec 2019 18:00:00 +0000 https://blog.codingmilitia.com/2019/12/01/equals-and-equals-are-not-equal/ &ldquo;Equals&rdquo; vs &ldquo;==&rdquo; is an old topic, but as it&rsquo;s often times forgotten, there&rsquo;s probably no harm in talking about it again. Episode 032 - Upgrading to ASP.NET Core 3.0 - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/11/21/aspnet-032-from-zero-to-overkill-upgrading-to-aspnet-core-30/ Thu, 21 Nov 2019 18:30:00 +0100 https://blog.codingmilitia.com/2019/11/21/aspnet-032-from-zero-to-overkill-upgrading-to-aspnet-core-30/ In this episode, we&rsquo;ll go through the main changes required to upgrade our currently ASP.NET Core 2.2 applications to ASP.NET Core 3.0. A year remote https://blog.codingmilitia.com/2019/11/03/a-year-remote/ Sun, 03 Nov 2019 16:45:00 +0000 https://blog.codingmilitia.com/2019/11/03/a-year-remote/ It has recently been a year since I started working remotely, so I thought it could be interesting to share my experience, along with some particularities of my remote setting. Episode 031 - Some simple unit tests with xUnit - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/10/25/aspnet-031-from-zero-to-overkill-some-simple-unit-tests-with-xunit/ Fri, 25 Oct 2019 18:00:00 +0100 https://blog.codingmilitia.com/2019/10/25/aspnet-031-from-zero-to-overkill-some-simple-unit-tests-with-xunit/ In this episode, we&rsquo;ll take a little break from the explorations we&rsquo;ve been doing in the latest episodes, getting back to fundamentals and writing some really simple unit tests with xUnit. Episode 030 - Analyzing performance with BenchmarkDotNet - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/10/08/aspnet-030-from-zero-to-overkill-analyzing-performance-with-benchmarkdotnet/ Tue, 08 Oct 2019 17:45:00 +0100 https://blog.codingmilitia.com/2019/10/08/aspnet-030-from-zero-to-overkill-analyzing-performance-with-benchmarkdotnet/ In this episode, we&rsquo;ll take a look at BenchmarkDotNet, to explore the performance characteristics of our code and help us make better decisions when trying to optimize it. Episode 029 - Simplifying the BFF with ProxyKit - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/09/11/aspnet-029-from-zero-to-overkill-simplifying-the-bff-with-proxykit/ Wed, 11 Sep 2019 18:30:00 +0100 https://blog.codingmilitia.com/2019/09/11/aspnet-029-from-zero-to-overkill-simplifying-the-bff-with-proxykit/ In this episode, we&rsquo;ll revise our current backend for frontend implementation, introducing ProxyKit to simplify request routing to backing APIs, foregoing the need to implement everything manually. Episode 028 - Multiple service instances tweaks - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/08/31/aspnet-028-from-zero-to-overkill-multiple-service-instances-tweaks/ Sat, 31 Aug 2019 12:30:00 +0100 https://blog.codingmilitia.com/2019/08/31/aspnet-028-from-zero-to-overkill-multiple-service-instances-tweaks/ In this episode, we&rsquo;ll take a look at some things we need to keep in mind when we want to run multiple instances of an ASP.NET Core application, namely data protection configuration and how it impacts our application even without us using it directly. Episode 027 - Up and running with Docker Compose - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/08/12/aspnet-027-from-zero-to-overkill-up-and-running-with.docker-compose/ Mon, 12 Aug 2019 17:30:00 +0100 https://blog.codingmilitia.com/2019/08/12/aspnet-027-from-zero-to-overkill-up-and-running-with.docker-compose/ In this episode, we&rsquo;ll take the Docker containers we prepared previously and use Docker Compose to get the complete PlayBall application running. Episode 026 - Getting started with Docker - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/07/29/aspnet-026-from-zero-to-overkill-getting-started-with-docker/ Mon, 29 Jul 2019 17:30:00 +0100 https://blog.codingmilitia.com/2019/07/29/aspnet-026-from-zero-to-overkill-getting-started-with-docker/ In this episode, we&rsquo;ll be creating Docker containers for our applications, with the goal of making it easier to get them all running as a whole. Episode 025 - Integrating IdentityServer4 - Part 5 - Frontend - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/07/13/aspnet-025-from-zero-to-overkill-integrating-identityserver4-part5-frontend/ Sat, 13 Jul 2019 15:30:00 +0100 https://blog.codingmilitia.com/2019/07/13/aspnet-025-from-zero-to-overkill-integrating-identityserver4-part5-frontend/ In this episode, we take a look at our frontend single page application, and the changes made to handle user authentication. We also take a look at a way to handle the CSRF token in the requests made to the BFF. Episode 024 - Integrating IdentityServer4 - Part 4 - Back for Front - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/06/22/aspnet-024-from-zero-to-overkill-integrating-identityserver4-part4-back-for-front/ Sat, 22 Jun 2019 23:00:00 +0100 https://blog.codingmilitia.com/2019/06/22/aspnet-024-from-zero-to-overkill-integrating-identityserver4-part4-back-for-front/ In this episode, we look at the backend for frontend, and the changes required for it to handle the users authentication, redirection to the identity provider (the IdentityServer4 powered auth service), the inclusion of an access token when making API calls, the refresh of said token and handling CSRF tokens. Episode 023 - Integrating IdentityServer4 - Part 3 - API - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/06/16/aspnet-023-from-zero-to-overkill-integrating-identityserver4-part3-api/ Sun, 16 Jun 2019 20:00:00 +0100 https://blog.codingmilitia.com/2019/06/16/aspnet-023-from-zero-to-overkill-integrating-identityserver4-part3-api/ In this episode, we look at the group management service, and the changes required for it to enforce the requests authentication using an access token (JWT). Episode 022 - Integrating IdentityServer4 - Part 2 - Auth Service - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/06/13/aspnet-022-from-zero-to-overkill-integrating-identityserver4-part2-auth-service/ Thu, 13 Jun 2019 18:00:00 +0100 https://blog.codingmilitia.com/2019/06/13/aspnet-022-from-zero-to-overkill-integrating-identityserver4-part2-auth-service/ In this episode, we start looking at the code needed to integrate IdentityServer4 in our application, namely with the authentication service we developed previously. Episode 021 - Integrating IdentityServer4 - Part 1 - Overview - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/05/29/aspnet-021-from-zero-to-overkill-integrating-identityserver4-part1-overview/ Wed, 29 May 2019 19:20:00 +0100 https://blog.codingmilitia.com/2019/05/29/aspnet-021-from-zero-to-overkill-integrating-identityserver4-part1-overview/ In this episode, we start with an overview of the current application&rsquo;s architecture and how we&rsquo;ll start integrating IdentityServer4 into it. The Uri composition mystery https://blog.codingmilitia.com/2019/05/22/the-uri-composition-mystery/ Wed, 22 May 2019 21:30:00 +0100 https://blog.codingmilitia.com/2019/05/22/the-uri-composition-mystery/ A quick tale of an idiot wasting hours by not checking the docs earlier. Episode 020 - The backend for frontend and the HttpClient - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/05/05/aspnet-020-from-zero-to-overkill-backend-for-frontend-httpclient/ Sun, 05 May 2019 09:30:00 +0100 https://blog.codingmilitia.com/2019/05/05/aspnet-020-from-zero-to-overkill-backend-for-frontend-httpclient/ In this episode, we&rsquo;ll start building our backend for frontend, which will bridge the interaction between the Vue.js frontend application and the backend APIs we&rsquo;ll develop. For now this will be mostly an excuse for playing with the HttpClient in ASP.NET Core, as we&rsquo;ll improve the BFF in the future, with some proxying capabilities for requests that don&rsquo;t need additional logic. Episode 019 - Roles, claims and policies - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/04/29/aspnet-019-from-zero-to-overkill-roles-claims-policies/ Mon, 29 Apr 2019 18:30:00 +0100 https://blog.codingmilitia.com/2019/04/29/aspnet-019-from-zero-to-overkill-roles-claims-policies/ In this episode, we get back to the authorization topic, playing a bit with roles, claims and policies in ASP.NET Core, learning how we can use these to restrict access to certain areas of our application. Episode 018 - Internationalization - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/04/24/aspnet-018-from-zero-to-overkill-internationalization/ Wed, 24 Apr 2019 21:30:00 +0100 https://blog.codingmilitia.com/2019/04/24/aspnet-018-from-zero-to-overkill-internationalization/ In this episode, we&rsquo;ll use ASP.NET Core internationalization support to make our authentication service available in multiple languages. Episode 017 - More Identity, more Razor Pages - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/03/31/aspnet-017-from-zero-to-overkill-more-identity-more-razor-pages/ Sun, 31 Mar 2019 18:00:00 +0100 https://blog.codingmilitia.com/2019/03/31/aspnet-017-from-zero-to-overkill-more-identity-more-razor-pages/ In this episode, we continue exploring ASP.NET Core Identity and Razor Pages as we continue development of our authentication service. Episode 016 - Authentication with Identity and Razor Pages - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/02/24/aspnet-016-from-zero-to-overkill-authentication-with-identity-and-razor-pages/ Sun, 24 Feb 2019 16:20:00 +0000 https://blog.codingmilitia.com/2019/02/24/aspnet-016-from-zero-to-overkill-authentication-with-identity-and-razor-pages/ In this episode, we start building the authentication service, using ASP.NET Core Identity and Razor Pages. It will be a standalone application centralizing all the required user authentication logic. Episode 015 - Calling the Web API from the frontend - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/02/12/aspnet-015-from-zero-to-overkill-calling-the-web-api-from-the-frontend/ Tue, 12 Feb 2019 17:30:00 +0000 https://blog.codingmilitia.com/2019/02/12/aspnet-015-from-zero-to-overkill-calling-the-web-api-from-the-frontend/ Wrapping up this first look at the frontend application built with Vue.js, in this episode we make it work with the group management Web API we developed so far. Episode 014 - Centralizing frontend state with Vuex - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/02/07/aspnet-014-from-zero-to-overkill-centralizing-frontend-state-with-vuex/ Thu, 07 Feb 2019 19:30:00 +0000 https://blog.codingmilitia.com/2019/02/07/aspnet-014-from-zero-to-overkill-centralizing-frontend-state-with-vuex/ In this episode, we continue playing around in the frontend, by centralizing all state using Vuex, making use of the patterns that are probably more popular lately due to their use with React and Redux. Episode 013 - Starting the frontend with Vue.js - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/02/02/aspnet-013-from-zero-to-overkill-starting-the-frontend-with-vuejs/ Sat, 02 Feb 2019 19:20:00 +0000 https://blog.codingmilitia.com/2019/02/02/aspnet-013-from-zero-to-overkill-starting-the-frontend-with-vuejs/ In this episode, we start the frontend development with Vue.js. One can say this isn&rsquo;t ASP.NET Core, but we do need a frontend and single page applications are all the rage these days, so we&rsquo;re going with the flow šŸ˜› Episode 012 - Move to a Web API - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/01/26/aspnet-012-from-zero-to-overkill-move-to-a-web-api/ Sat, 26 Jan 2019 17:30:00 +0000 https://blog.codingmilitia.com/2019/01/26/aspnet-012-from-zero-to-overkill-move-to-a-web-api/ In this episode, we start transforming the current application into a Web API, so it can be used in the single page application we&rsquo;ll be developing. Episode 011 - Data access with Entity Framework Core - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2019/01/16/aspnet-011-from-zero-to-overkill-data-access-with-entity-framework-core/ Wed, 16 Jan 2019 20:45:00 +0000 https://blog.codingmilitia.com/2019/01/16/aspnet-011-from-zero-to-overkill-data-access-with-entity-framework-core/ In this episode, we replace our current groups &ldquo;persistence&rdquo; with an actual database, accessing it with Entity Framework Core. Episode 010 - Async all the things - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/12/17/aspnet-010-from-zero-to-overkill-async-all-the-things/ Mon, 17 Dec 2018 20:00:00 +0000 https://blog.codingmilitia.com/2018/12/17/aspnet-010-from-zero-to-overkill-async-all-the-things/ In this episode, we take a look at using async await in ASP.NET Core, why it&rsquo;s important, the happy path and some sad paths, along with some interesting bits. Episode 009 - MVC filters - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/12/10/aspnet-009-from-zero-to-overkill-mvc-filters/ Mon, 10 Dec 2018 17:25:00 +0000 https://blog.codingmilitia.com/2018/12/10/aspnet-009-from-zero-to-overkill-mvc-filters/ Following up on the previous episode on ASP.NET Core middlewares, in this episode we take a look at MVC&rsquo;s filters, an MVC specific way to add behaviors to our request handling pipeline, and how we can use them to implement cross-cutting concerns in our web applications. Episode 008 - Middlewares - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/12/05/aspnet-008-from-zero-to-overkill-middlewares/ Wed, 05 Dec 2018 18:30:00 +0000 https://blog.codingmilitia.com/2018/12/05/aspnet-008-from-zero-to-overkill-middlewares/ In this episode we take a look at ASP.NET Core&rsquo;s middlewares, how to create them and use them in the request handling pipeline. Episode 007 - Logging - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/11/21/aspnet-007-from-zero-to-overkill-logging/ Wed, 21 Nov 2018 19:30:00 +0000 https://blog.codingmilitia.com/2018/11/21/aspnet-007-from-zero-to-overkill-logging/ In this episode we take a look at logging in ASP.NET Core, the builtin support and providers, as well as using third party implementations, namely NLog. Episode 006 - Configuration - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/11/16/aspnet-006-from-zero-to-overkill-configuration/ Fri, 16 Nov 2018 19:00:00 +0000 https://blog.codingmilitia.com/2018/11/16/aspnet-006-from-zero-to-overkill-configuration/ In this episode we take a look at configuration in ASP.NET Core, the possible sources, how to read from them, the options pattern, wrapping up with development time secrets. Episode 005 - Dependency Injection - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/11/04/aspnet-005-from-zero-to-overkill-dependency-injection/ Sun, 04 Nov 2018 11:30:00 +0000 https://blog.codingmilitia.com/2018/11/04/aspnet-005-from-zero-to-overkill-dependency-injection/ In this episode we go a little bit deeper into dependency injection, extracting our logic from the controller and into a service. Episode 004 - The Program and Startup classes - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/10/27/aspnet-004-from-zero-to-overkill-the-program-and-startup-classes/ Sat, 27 Oct 2018 21:45:00 +0100 https://blog.codingmilitia.com/2018/10/27/aspnet-004-from-zero-to-overkill-the-program-and-startup-classes/ In this episode we take a step back to look at some important infrastructure parts of an ASP.NET Core application - the Program and the Startup classes. Episode 003 - First steps with MVC - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/10/13/aspnet-003-from-zero-to-overkill-first-steps-with-mvc/ Sat, 13 Oct 2018 16:30:00 +0100 https://blog.codingmilitia.com/2018/10/13/aspnet-003-from-zero-to-overkill-first-steps-with-mvc/ In this episode we pick up on the component started previously for group management, to start adding some ASP.NET Core MVC goodness to it. Episode 002 - Project structure plus first application - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/10/07/aspnet-002-from-zero-to-overkill-project-structure-plus-first-application/ Sun, 07 Oct 2018 10:00:00 +0100 https://blog.codingmilitia.com/2018/10/07/aspnet-002-from-zero-to-overkill-project-structure-plus-first-application/ In this post we finally see some code, although not much šŸ˜› We start by checking out the project structure that&rsquo;ll be used in .NET repositories and then find our way through the command line to create the solution and C# project for the group management component. Episode 001 - The Reference Project - ASP.NET Core: From 0 to overkill https://blog.codingmilitia.com/2018/10/06/aspnet-001-from-zero-to-overkill-the-reference-project/ Sat, 06 Oct 2018 18:20:00 +0100 https://blog.codingmilitia.com/2018/10/06/aspnet-001-from-zero-to-overkill-the-reference-project/ In this post, we&rsquo;ll take a look at the objective of the reference, before starting to code like there&rsquo;s no tomorrow without anyone understanding the context. ASP.NET Core: From 0 to overkill - Intro https://blog.codingmilitia.com/2018/10/02/aspnet-000-from-zero-to-overkill-intro/ Tue, 02 Oct 2018 22:40:00 +0100 https://blog.codingmilitia.com/2018/10/02/aspnet-000-from-zero-to-overkill-intro/ This post serves as an introduction to a new series of videos (and I&rsquo;ll try to accompany them with posts) on creating a complex application using on ASP.NET Core. Finally found a cross-platform Excel parsing library https://blog.codingmilitia.com/2018/09/15/finally-found-a-cross-platform-excel-parsing-library/ Sat, 15 Sep 2018 13:00:00 +0100 https://blog.codingmilitia.com/2018/09/15/finally-found-a-cross-platform-excel-parsing-library/ I have surely been living under a rock, not knowing about the ExcelDataReader library, but now I do! First look at Kotlin - my first pains https://blog.codingmilitia.com/2018/09/12/first-look-at-kotlin-my-first-pains/ Wed, 12 Sep 2018 19:45:00 +0100 https://blog.codingmilitia.com/2018/09/12/first-look-at-kotlin-my-first-pains/ A quick walk-through of a couple of problems I ran into when first trying to build a web api with Kotlin [Redirect Magazine] #27 - ASP.NET Core and Serilog, techie to tech lead, microservices and messaging https://blog.codingmilitia.com/2018/09/09/redirect-magazine-0027-aspnetcore-serilog-tech-lead-microservices-messaging/ Sun, 09 Sep 2018 11:00:00 +0100 https://blog.codingmilitia.com/2018/09/09/redirect-magazine-0027-aspnetcore-serilog-tech-lead-microservices-messaging/ <p>Another week, another bunch of links!</p> <p>I think I&rsquo;ll reduce the cadence from now on though, to do a little more of my own posts/videos and not have the blog almost exclusively filled with links šŸ™‚.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://andrewlock.net/writing-logs-to-elasticsearch-with-fluentd-using-serilog-in-asp-net-core/">&ldquo;Writing logs to Elasticsearch with Fluentd using Serilog in ASP.NET Core&rdquo;</a></h2> <p>The title says it all šŸ™‚ Nice and simple article on the subject. <br/></p> <h2 id="heading-1"><a href="https://www.thoughtworks.com/insights/blog/techie-tech-lead-my-5-biggest-mistakes">&ldquo;Techie to tech lead: My five biggest mistakes&rdquo;</a></h2> <p>Interesting article on some mistakes one might make when transitioning from a technical role to a leadership one. <br/></p> [Redirect Magazine] #26 - Web performance, constructor over-injection and the Elastic stack https://blog.codingmilitia.com/2018/09/02/redirect-magazine-0026-web-performance-constructor-over-injection-elastic/ Sun, 02 Sep 2018 10:20:00 +0100 https://blog.codingmilitia.com/2018/09/02/redirect-magazine-0026-web-performance-constructor-over-injection-elastic/ <p>Have at it!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.troyhunt.com/i-wanna-go-fast-why-searching-through-500m-pwned-passwords-is-so-quick/">&ldquo;I Wanna Go Fast: Why Searching Through 500M Pwned Passwords Is So Quick&rdquo;</a></h2> <p>Really cool post on web performance by Troy Hunt on hist Have I Been Pwned project. <br/></p> <h2 id="heading-1"><a href="http://blog.ploeh.dk/2018/08/27/on-constructor-over-injection/">&ldquo;On Constructor Over-injection&rdquo;</a></h2> <p>Can&rsquo;t add much on this article, the title is self explanatory and the article is short and to the point. <br/></p> <h1 id="videos">Videos</h1> <h2 id="heading-2"><a href="https://youtu.be/t4BC2IQLL_0">&ldquo;Data magic with the Elastic stack! - Aleksander Stensby&rdquo;</a></h2> <p>Cool talk on some interesting capabilities of Elastic Search and Kibana.</p> [Redirect Magazine] #25 - Event sourcing problems, Bing on .NET Core 2.1 and testing distributed systems https://blog.codingmilitia.com/2018/08/26/redirect-magazine-0025-event-sourcing-problems-bind-dotnet-core-testing-distributed-systems/ Sun, 26 Aug 2018 12:20:00 +0100 https://blog.codingmilitia.com/2018/08/26/redirect-magazine-0025-event-sourcing-problems-bind-dotnet-core-testing-distributed-systems/ <p>And we&rsquo;re in for another round!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://medium.com/@hugo.oliveira.rocha/what-they-dont-tell-you-about-event-sourcing-6afc23c69e9a">&ldquo;What they don’t tell you about event sourcing&rdquo;</a></h2> <p>Nice read on some problems that might arise when using CQRS and event sourcing. <br/></p> <h2 id="heading-1"><a href="https://blogs.msdn.microsoft.com/dotnet/2018/08/20/bing-com-runs-on-net-core-2-1">&ldquo;Bing.com runs on .NET Core 2.1!&rdquo;</a></h2> <p>Interesting to know how Bing is benefiting from .NET Core performance improvements. Even if you (and I) don’t like/use Bing, it’s still a massive project and a great way to see how .NET Core behaves at such scale. <br/></p> [TIL] int vs short and the (unexpected) performance impact https://blog.codingmilitia.com/2018/08/25/til-int-vs-short-and-the-unexpected-performance-impact/ Sat, 25 Aug 2018 12:30:00 +0100 https://blog.codingmilitia.com/2018/08/25/til-int-vs-short-and-the-unexpected-performance-impact/ Quick little post on a probably unexpected performance difference when using an int instead of a short in C# [Redirect Magazine] #24 - Service boundaries, orchestrating containers, event sourcing and CQRS, plus some ASP.NET Core less known features https://blog.codingmilitia.com/2018/08/19/redirect-magazine-0024-service-boundaries-orchestrating-containers-event-sourcing-cqrs-aspnet/ Sun, 19 Aug 2018 18:30:00 +0100 https://blog.codingmilitia.com/2018/08/19/redirect-magazine-0024-service-boundaries-orchestrating-containers-event-sourcing-cqrs-aspnet/ <p>This week, no reading, just watching šŸ™‚</p> <p>(Now that I&rsquo;m looking at it closely, all the videos are from NDC Oslo 2018)</p> <h1 id="videos">Videos</h1> <h2 id="heading"><a href="https://youtu.be/tVnIUZbsxWI">&ldquo;Finding your service boundaries - a practical guide - Adam Ralph&rdquo;</a></h2> <p>Great talk on defining the service boundaries, one of the topics I find most challenging when creating a new system, but also very interesting.</p> <p><div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/tVnIUZbsxWI?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <br/></p> [Video] Creating a CI/CD pipeline for a .NET library https://blog.codingmilitia.com/2018/08/19/video-creating-ci-cd-pipeline-dotnet-library/ Sun, 19 Aug 2018 09:50:00 +0100 https://blog.codingmilitia.com/2018/08/19/video-creating-ci-cd-pipeline-dotnet-library/ Video series on setting up a complete CI/CD pipeline for a .NET library, from building and testing in different platforms, visualizing code coverage and publishing the binaries to NuGet.' [Redirect Magazine] #23 - distributed systems, testing, more distributed systems and actors on distributed systems https://blog.codingmilitia.com/2018/08/12/redirect-magazine-0023-distibuted-systems-testing-actors/ Sun, 12 Aug 2018 19:45:00 +0100 https://blog.codingmilitia.com/2018/08/12/redirect-magazine-0023-distibuted-systems-testing-actors/ <p>A couple of reads and a couple of watches.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://jimmybogard.com/life-beyond-transactions-implementation-primer/">&ldquo;Life Beyond Distributed Transactions: An Apostate&rsquo;s Implementation - A Primer&rdquo;</a></h2> <p>Nice series of articles (not yet finished) on implementing transactional logic in a distributed system without resorting to the traditional SQL distributed transactions. <br/></p> <h2 id="heading-1"><a href="http://blog.codepipes.com/testing/software-testing-antipatterns.html">&ldquo;Software Testing Anti-patterns&rdquo;</a></h2> <p>Excellent thorough article on testing anti-patterns, technology stack agnostic, with valuable information to make sure we get the most out of our tests. <br/></p> [Redirect Magazine] #22 - Imaginary problems, .NET pipelines, patterns misuse, architecture resources and CI/CD https://blog.codingmilitia.com/2018/08/05/redirect-magazine-0022-imaginary-problems-dotnet-pipelines-patterns-misuse-architecture-resources-ci-cd/ Sun, 05 Aug 2018 17:45:00 +0100 https://blog.codingmilitia.com/2018/08/05/redirect-magazine-0022-imaginary-problems-dotnet-pipelines-patterns-misuse-architecture-resources-ci-cd/ <p>Another week gone by (and this wasn&rsquo;t a cold one over here), another bunch of links.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://medium.com/@george3d6/imaginary-problems-d4f2921bd1b8">&ldquo;Imaginary problems, the root of bad software&rdquo;</a></h2> <p>Very nice post on the problems, the real and the imaginary ones, we face on our jobs. After reading I’m pretty confident you can relate. <br/></p> <h2 id="heading-1"><a href="https://blog.marcgravell.com/2018/07/pipe-dreams-part-3.html">&ldquo;Pipelines - a guided tour of the new IO API in .NET, part 3&rdquo;</a></h2> <p>Another really nice article on .NET&rsquo;s pipelines from Marc Gravell. Really thorough and awesome to get to know these lower level network and IO related topics, really different from the usual application code many of us write daily. <br/></p> Creating a CI/CD pipeline for a .NET library: Part 3 - Building on AppVeyor and Travis CI https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-03-building-on-appveyor-and-travis-ci/ Mon, 30 Jul 2018 20:00:02 +0100 https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-03-building-on-appveyor-and-travis-ci/ In this third post we get our build running in the cloud, compiling and testing in Windows, Linux and MacOS. Creating a CI/CD pipeline for a .NET library: Part 4 - Code coverage on Coveralls, badges and wrap up https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-04-coverage-coveralls-badges-wrap-up/ Mon, 30 Jul 2018 20:00:02 +0100 https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-04-coverage-coveralls-badges-wrap-up/ In this fourth post, we&rsquo;ll add the final touches to the pipeline, publishing the code coverage report and adding some badges to GitHub. Creating a CI/CD pipeline for a .NET library: Part 2 - Defining the build with Cake and publishing to NuGet https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-02-defining-the-build-with-cake-publish-nuget/ Mon, 30 Jul 2018 20:00:01 +0100 https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-02-defining-the-build-with-cake-publish-nuget/ In this second post we get started with the CI/CD pipeline, defining the build steps in C# using Cake. Creating a CI/CD pipeline for a .NET library: Part 1 - Intro https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-01-intro/ Mon, 30 Jul 2018 20:00:00 +0100 https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-01-intro/ Setting up a complete CI/CD pipeline for a .NET library, from building and testing in different platforms, visualizing code coverage and publishing the binaries to NuGet. [Redirect Magazine] #21 - Web architecture fundamentals, stability patterns and antipatterns plus a quick look at Kotlin https://blog.codingmilitia.com/2018/07/29/redirect-magazine-0021-web-architecture-fundamentals-stability-patterns-antipatterns-kotlin/ Sun, 29 Jul 2018 09:50:00 +0100 https://blog.codingmilitia.com/2018/07/29/redirect-magazine-0021-web-architecture-fundamentals-stability-patterns-antipatterns-kotlin/ <p>Not a big list this week, as I&rsquo;ve been working on my own posts most of the time. Hopefully I&rsquo;m able to get them published by tomorrow.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://engineering.videoblocks.com/web-architecture-101-a3224e126947">&ldquo;Web Architecture 101&rdquo;</a></h2> <p>Nice article on a typical system&rsquo;s main architecture components. Maybe a given for more senior developers, but I find it an interesting quick intro for less experienced ones. <br/></p> <h1 id="videos">Videos</h1> <h2 id="heading-1"><a href="https://youtu.be/VZePNGQojfA">&ldquo;GOTO 2016 • Stability Patterns &amp; Antipatterns • Michael T. Nygard&rdquo;</a></h2> <p>Very interesting talk on systems stability and availability, some examples of weird things that happened from the speaker&rsquo;s experience, some patterns and anti-patterns.</p> [Redirect Magazine] #20 - Debugging HTTP requests in Docker, homographs, learning new things and evolutionary architectures https://blog.codingmilitia.com/2018/07/22/redirect-magazine-0020-debugging-http-docker-homographs-learning-evolutionary-architectures/ Sun, 22 Jul 2018 10:50:00 +0100 https://blog.codingmilitia.com/2018/07/22/redirect-magazine-0020-debugging-http-docker-homographs-learning-evolutionary-architectures/ <p>Been reading through my saved posts on <a href="https://dev.to">dev.to</a>, so the source for today is mostly that.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://dev.to/jandedobbeleer/intercept-http-traffic-exiting-a-docker-container-3g68">&ldquo;Intercept HTTP traffic exiting a docker container&rdquo;</a></h2> <p>Nice example on how to intercept HTTP and HTTPS requests coming from a Docker container for debugging. <br/></p> <h2 id="heading-1"><a href="https://dev.to/loganmeetsworld/homographs-attack--5a1p">&ldquo;Homographs, Attack!&rdquo;</a></h2> <p>Had already seen some quick articles on these kinds of attacks where the URL for a page is not what it looks like, but this is a really good post explaining things in more depth. <br/></p> [Redirect Magazine] #19 - Microservices gone sour, OOP done wrong, more on .NET's new Pipelines and HTTPS all the things https://blog.codingmilitia.com/2018/07/15/redirect-magazine-0019-microservices-gone-sour-oop-done-wrong-dotnet-pipelines-https/ Sun, 15 Jul 2018 19:30:00 +0100 https://blog.codingmilitia.com/2018/07/15/redirect-magazine-0019-microservices-gone-sour-oop-done-wrong-dotnet-pipelines-https/ <p>Some more reading material.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://segment.com/blog/goodbye-microservices/">&ldquo;Goodbye Microservices: From 100s of problem children to 1 superstar&rdquo;</a></h2> <p>Interesting read on an implementation of a microservice architecture that went wrong, and a come back to a monolithic approach that worked. Maybe the microservices approach was not the best one, maybe it wasn&rsquo;t just well implemented or adequate for the problem at hand, but it&rsquo;s an important lesson that sometimes it works, sometimes it doesn&rsquo;t an a monolith is just fine. <br/></p> [Redirect Magazine] #18 - Span, Memory and Pipelines on .NET Core 2.1 https://blog.codingmilitia.com/2018/07/08/redirect-magazine-0018-span-memory-pipelines-dotnet-core/ Sun, 08 Jul 2018 19:15:00 +0100 https://blog.codingmilitia.com/2018/07/08/redirect-magazine-0018-span-memory-pipelines-dotnet-core/ <p>This past week wasn&rsquo;t great productivity wise, but I could still get some reading on two pretty interesting .NET related topics.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.codemag.com/Article/1807051/Introducing-.NET-Core-2.1-Flagship-Types-Span-T-and-Memory-T">&ldquo;Introducing .NET Core 2.1 Flagship Types: Span T and Memory T&rdquo;</a></h2> <p>Nice overview on some of the biggest additions on .NET Core 2.1, Span<T> and Memory<T>. Some lower level stuff that could be really important for performance improvements. <br/></p> <h2 id="heading-1"><a href="https://blog.marcgravell.com/2018/07/pipe-dreams-part-1.html">&ldquo;Pipelines - a guided tour of the new IO API in .NET, part 1&rdquo;</a></h2> <p>Series of posts on a new set of APIs introduced in .NET Core 2.1 to work with IO - Pipelines. <br/> <br/> Cyaz!</p> [Redirect Magazine] #17 - Using containers for build environments, configuration in .NET Core, HTTPS all the things, containerized distributed data stores and Shopify's architecture https://blog.codingmilitia.com/2018/07/01/redirect-magazine-0017-containerized-build-environments-dotnet-configuration-https-containerized-data-stores-shopify-architecture/ Sun, 01 Jul 2018 18:30:00 +0100 https://blog.codingmilitia.com/2018/07/01/redirect-magazine-0017-containerized-build-environments-dotnet-configuration-https-containerized-data-stores-shopify-architecture/ <p>Another pair of each to wrap up the weekend.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://jimmybogard.com/containers-what-are-they-good-for-crafting-our-build-environments/">&ldquo;Containers - What Are They Good For? Crafting our Build Environments&rdquo;</a></h2> <p>Quick post on using Docker containers to create a build environment for .NET projects. <br/></p> <h2 id="heading-1"><a href="http://www.paraesthesia.com/archive/2018/06/20/microsoft-extensions-configuration-deep-dive/">&ldquo;Deep Dive into Microsoft Configuration&rdquo;</a></h2> <p>Excellent thorough walkthrough of the configuration system used in .NET Core applications. <br/></p> <h2 id="heading-2"><a href="https://httpsiseasy.com/">&ldquo;HTTPS Is Easy!&rdquo;</a></h2> <p>Don&rsquo;t be one of those that says &ldquo;my site doesn&rsquo;t need HTTPS because of reasons&rdquo;! HTTPS all the things! <br/></p> [Redirect Magazine] #16 - Sharing sources through NuGet, modern .NET overview, some more microservices and a tour through programming history https://blog.codingmilitia.com/2018/06/24/redirect-magazine-0016-sharing-sources-nuget-modern-dotnet-microservices-tour-programming-history/ Sun, 24 Jun 2018 10:30:00 +0100 https://blog.codingmilitia.com/2018/06/24/redirect-magazine-0016-sharing-sources-nuget-modern-dotnet-microservices-tour-programming-history/ <p>Another week, another round, today more videos than articles.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://medium.com/@attilah/source-code-only-nuget-packages-8f34a8fb4738">&ldquo;Source Code Only NuGet Packages&rdquo;</a></h2> <p>Knowing I could do this would have been useful in the past&hellip; at least I know now :) <br/></p> <h1 id="videos">Videos</h1> <h2 id="heading-1"><a href="https://youtu.be/qugNNPXQfCs">&ldquo;Why I’m Not Leaving .NET - Mark Rendle&rdquo;</a></h2> <p>A tour on some features that make it working with .NET right now one of the best times it has ever been.</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/qugNNPXQfCs?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <br/> ## ["Microservices: How To Build Systems That Survive"](https://youtu.be/rNQR1HqfEl0) Some ideas on using microservices (or small components as it's referred to by the speaker) to build systems that aren't completely rebuilt every now and then, but rather replacing components as needed (eventually leading to a completely rewritten system code anyway). <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/rNQR1HqfEl0?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <br/> ## ["GOTO 2018 • Old Is the New New • Kevlin Henney"](https://youtu.be/AbgsfeGvg3E) Kevlin Henney with another tour on our "new" software development ideas and paradigms, and where they came from. <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/AbgsfeGvg3E?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <br/> Cyaz! [Redirect Magazine] #15 - Performance with strings in .NET, cryptography, Node.js issues, microservices and clean architecture https://blog.codingmilitia.com/2018/06/17/redirect-magazine-0015-dotnet-strings-performance-cryptography-nodejs-issues-microservices-clean-architecture/ Sun, 17 Jun 2018 17:00:00 +0100 https://blog.codingmilitia.com/2018/06/17/redirect-magazine-0015-dotnet-strings-performance-cryptography-nodejs-issues-microservices-clean-architecture/ <p>Today, besides the usual articles and videos, I added a podcast into the mix.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://medium.com/@indy_singh/strings-are-evil-a803d05e5ce3">&ldquo;Strings Are Evil&rdquo;</a></h2> <p>Very cool article on massively improving the performance of a document parsing application, mainly in regard to memory allocations, and the issues working with strings carelessly in .NET can cause. <br/></p> <h2 id="heading-1"><a href="https://docs.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode">&ldquo;Timing vulnerabilities with CBC-mode symmetric decryption using padding&rdquo;</a></h2> <p>Using cryptography correctly ain’t a walk in a park. I don&rsquo;t usually read much about this topic, but it&rsquo;s important to at least be alert to some things, so we&rsquo;re able to talk to someone who really understands the topic and we can be confident our code isn&rsquo;t vulnerability ridden. <br/></p> [Redirect Magazine] #14 - Micro Frontends, Polly extensions for HttpClient, WebSockets and Nginx https://blog.codingmilitia.com/2018/06/10/redirect-magazine-0014-microfrontends-polly-httpclient-extensions-websockets-nginx/ Sun, 10 Jun 2018 10:00:00 +0100 https://blog.codingmilitia.com/2018/06/10/redirect-magazine-0014-microfrontends-polly-httpclient-extensions-websockets-nginx/ <p>Have at it!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://micro-frontends.org/">&ldquo;Micro Frontends&rdquo;</a></h2> <p>On the same page as a video I shared on Redirect Magazine #12, this article talks about taking the microservices architecture into the frontend, so we don&rsquo;t end up with a fancy microservice backend coupled with a monolithic frontend, kind of defeating the purpose of the architectural decision in the first place. <br/></p> <h2 id="heading-1"><a href="https://www.stevejgordon.co.uk/httpclientfactory-using-polly-for-transient-fault-handling">&ldquo;HttpClientFactory in ASP.NET Core 2.1 (Part 4) - Integrating with Polly for transient fault handling&rdquo;</a></h2> <p>I&rsquo;ve made some posts on using Polly to improve .NET applications resilience in the past, so it&rsquo;s nice that it now as some helpers to be integrated with <code>HttpClient</code> in ASP.NET Core. <br/></p> [Redirect Magazine] #13 - .NET Core 2.1 released, Twelve-Factor App, Reactive Manifesto, readable code, Rx on the cloud and extra JS stuff https://blog.codingmilitia.com/2018/06/02/redirect-magazine-0013-dotnet-core-12-factor-app-reactive-manifesto-readable-code-rx-cloud-more-js/ Sat, 02 Jun 2018 10:15:00 +0100 https://blog.codingmilitia.com/2018/06/02/redirect-magazine-0013-dotnet-core-12-factor-app-reactive-manifesto-readable-code-rx-cloud-more-js/ <p>Here ye go!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://blogs.msdn.microsoft.com/dotnet/2018/05/30/announcing-net-core-2-1/">&ldquo;Announcing .NET Core 2.1&rdquo;</a></h2> <p>.NET Core 2.1 is now final and here’s what it brings. <br/></p> <h2 id="heading-1"><a href="https://12factor.net/">&ldquo;The Twelve-Factor App&rdquo;</a></h2> <p>Nice set of guidelines on developing applications (focusing on SaaS). This is really far from new, but I only recently got around to reading the whole thing. By now most of what’s described sounds a bit obvious, but it’s good it’s written somewhere. <br/></p> <h2 id="heading-2"><a href="https://www.reactivemanifesto.org/">&ldquo;The Reactive Manifesto&rdquo;</a></h2> <p>In the spirit of the previous article, another set of recommendations for application development, making them ā€œreactiveā€. This has more of a focus on distributed systems and how the various components should interact. <br/></p> [Redirect Magazine] #12 - More JS inner workings, serverless, ASP.NET Core 2.1 and microservice websites https://blog.codingmilitia.com/2018/05/27/redirect-magazine-0012-js-inner-workings-serverless-aspnet-core-21-microservice-websites/ Sun, 27 May 2018 15:00:00 +0100 https://blog.codingmilitia.com/2018/05/27/redirect-magazine-0012-js-inner-workings-serverless-aspnet-core-21-microservice-websites/ <p>Aaaaand it&rsquo;s another round incoming!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://blog.sessionstack.com/how-does-javascript-actually-work-part-1-b0bacc073cf">&ldquo;How JavaScript works: an overview of the engine, the runtime, and the call stack&rdquo;</a></h2> <p>A two part series of posts on how JS works, somewhat in line with some videos I shared in the past. <br/></p> <h2 id="heading-1"><a href="https://martinfowler.com/articles/serverless.html">&ldquo;Serverless Architectures&rdquo;</a></h2> <p>By now most of us have some idea of what serverless is, but this is a more comprehensive article that covers a lot of topics on this subject. <br/></p> [Redirect Magazine] #11 - Async stuff, cleaning up DI, using Git merge, Spotify engineering culture and new shiny things in EF Core https://blog.codingmilitia.com/2018/05/20/redirect-magazine-0011-async-cleaning-di-git-merge-spotify-engineering-culture-ef-core/ Sun, 20 May 2018 18:00:00 +0100 https://blog.codingmilitia.com/2018/05/20/redirect-magazine-0011-async-cleaning-di-git-merge-spotify-engineering-culture-ef-core/ <p>Had to get into some last minute reading to have enough links to share, but here they are! :)</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://blog.scooletz.com/2018/05/14/task-async-await-valuetask-ivaluetasksource-and-how-to-keep-your-sanity-in-modern-net-world/">&ldquo;Task, Async Await, ValueTask, IValueTaskSource and how to keep your sanity in modern .NET world&rdquo;</a></h2> <p>Starting with some history and getting into the latest additions, a nice little intro into the asynchronous features in .NET. <br/></p> <h2 id="heading-1"><a href="https://dev.to/scotthannen/tame-your-giant-beastly-dependency-injection-registration-class-and-ride-it-into-glorious-victory-am">&ldquo;Tame Your Giant, Beastly Dependency Injection Registration Class and Ride It Into Glorious Victory &ldquo;</a></h2> <p>Some recommendations on taking care of the dependency injection configuration code. <br/></p> Dotnetifying gRPC: Sane Edition https://blog.codingmilitia.com/2018/05/19/dotnetifying-grpc-sane-edition/ Sat, 19 May 2018 12:00:00 +0100 https://blog.codingmilitia.com/2018/05/19/dotnetifying-grpc-sane-edition/ Going about the usual way of implementing a gRPC service in .NET, creating some helpers to make it a more ASP.NET Core like experience. [Redirect Magazine] #10 - Events past week, .NET Core future, project versioning, Visual Studio Live Share, Angular 6 and the new SignalR https://blog.codingmilitia.com/2018/05/13/redirect-magazine-0010-dotnetcore-future-versioning-vs-live-share-angular-6-signalr/ Sun, 13 May 2018 08:30:00 +0100 https://blog.codingmilitia.com/2018/05/13/redirect-magazine-0010-dotnetcore-future-versioning-vs-live-share-angular-6-signalr/ <p>This past week had <a href="https://channel9.msdn.com/Events/Build/2018/">Microsoft Build</a> and <a href="https://www.youtube.com/playlist?list=PLOU2XLYxmsIInFRc3M44HUTQc3b_YJ4-Y">Google I/O</a>, lots of stuff to check out (and so little time).</p> <h1 id="articles">Articles</h1> <h2 id="net-core-3-and-support-for-windows-desktop-applications"><a href="https://blogs.msdn.microsoft.com/dotnet/2018/05/07/net-core-3-and-support-for-windows-desktop-applications/">&quot;.NET Core 3 and Support for Windows Desktop Applications&quot;</a></h2> <p>Some insights on whats coming in .NET Core. Many things are Windows only, but at least those that still need to target specifically Windows will be able to take advantage of .NET Core goodies when building desktop applications (WPF and Windows Forms). <br/></p> [Redirect Magazine] #9 - GraphQL vs REST, multi-targeting .NET libraries, analyzers and designing APIs https://blog.codingmilitia.com/2018/05/06/redirect-magazine-0009-graphql-rest-multi-targeting-libraries-analyzers-designing-apis/ Sun, 06 May 2018 12:00:00 +0100 https://blog.codingmilitia.com/2018/05/06/redirect-magazine-0009-graphql-rest-multi-targeting-libraries-analyzers-designing-apis/ <p>Slower week, a few more links anyways!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://dev.to/xngwng/rest-vs-graphql-apis-the-good-the-bad-the-ugly-34i8">&ldquo;REST vs GraphQL APIs, the Good, the Bad, the Ugly &ldquo;</a></h2> <p>Interesting comparison between REST and GraphQL APIs. <br/></p> <h2 id="heading-1"><a href="https://dev.to/davidwengier/targeting-builds-for-multiple-frameworks-and-machines-5h22">&ldquo;Targeting builds for multiple frameworks and machines&rdquo;</a></h2> <p>Nice read on a use case for multi targeting a .NET project across frameworks and operating systems, for a complete multi platform experience. <br/></p> <h2 id="heading-2"><a href="https://blogs.msdn.microsoft.com/seteplia/2018/05/03/avoiding-struct-and-readonly-reference-performance-pitfalls-with-errorprone-net/">&ldquo;Avoiding struct and readonly reference performance pitfalls with ErrorProne.NET&rdquo;</a></h2> <p>Introduction to a set of analyzers to help with some of the latest C# performance oriented features regarding structs. <br/></p> [Redirect Magazine] #8 - HttpClient, the actor model, saga pattern, ASP.NET Core issues and some more perf stuff https://blog.codingmilitia.com/2018/04/29/redirect-magazine-0008-httpclient-actor-model-saga-pattern-aspnetcore-issues-perf/ Sun, 29 Apr 2018 11:45:00 +0100 https://blog.codingmilitia.com/2018/04/29/redirect-magazine-0008-httpclient-actor-model-saga-pattern-aspnetcore-issues-perf/ <p>Here comes some more link goodness!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.hanselman.com/blog/HttpClientFactoryForTypedHttpClientInstancesInASPNETCore21.aspx">&ldquo;HttpClientFactory for typed HttpClient instances in ASP.NET Core 2.1&rdquo;</a></h2> <p>Using the new HttpClientFactory with ASP.NET Core 2.1. <br/></p> <h2 id="heading-1"><a href="https://www.stevejgordon.co.uk/introduction-to-httpclientfactory-aspnetcore">&ldquo;HttpClientFactory in ASP.NET Core 2.1 (Part 1)&rdquo;</a></h2> <p>Some more info on HttpClientFactory with ASP.NET Core 2.1. This is a much more detail set of articles then the one by Scott Hanselman. The link is for part one but you can then follow through the others, 3 in total at this moment. <br/></p> Using .NET's HttpClient without following redirects https://blog.codingmilitia.com/2018/04/28/using-dotnet-httpclient-without-following-redirects/ Sat, 28 Apr 2018 12:00:00 +0100 https://blog.codingmilitia.com/2018/04/28/using-dotnet-httpclient-without-following-redirects/ It&rsquo;s likely not a common scenario, but here&rsquo;s how one can use .NET&rsquo;s HttpClient without following redirects. [Redirect Magazine] #7 - Using Firefox, .NET Core 2.1 performance improvements, learning new skills and new C# features https://blog.codingmilitia.com/2018/04/22/redirect-magazine-0007-firefox-dotnet-core-performance-learning-csharp/ Sun, 22 Apr 2018 10:15:00 +0100 https://blog.codingmilitia.com/2018/04/22/redirect-magazine-0007-firefox-dotnet-core-performance-learning-csharp/ <p>&ldquo;Another day, another carrot&rdquo;&hellip; I mean, another redirect magazine!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.theverge.com/2018/4/15/17239548/firefox-chrome-safari-competition">&ldquo;It’s time to give Firefox a fresh chance&rdquo;</a></h2> <p>While not directly code related, I think this is an important topic. As developers we, better than anyone else, should know that having an application only work well on one browser is terrible. We haven’t even got rid of those horrible sites that require us to fire up Internet Explorer (and Java applets for that matter) and are slipping into a similar scenario with Chrome. Granted Chrome is a great browser, but that shouldn’t make it an excuse to be lazy and disregard everything else. As long as it’s not a steaming pile of crap and implements the standards, it should work. <br/></p> Using cancellation tokens on ASP.NET Core MVC actions https://blog.codingmilitia.com/2018/04/21/using-cancellation-tokens-on-aspnetcore-mvc-actions/ Sat, 21 Apr 2018 19:00:00 +0100 https://blog.codingmilitia.com/2018/04/21/using-cancellation-tokens-on-aspnetcore-mvc-actions/ Cancellation tokens are really useful when working with async stuff, and this is the simplest way of getting some nice free benefits in ASP.NET applications using them. Dotnetifying gRPC https://blog.codingmilitia.com/2018/04/15/dotnetifying-grpc/ Sun, 15 Apr 2018 20:40:00 +0100 https://blog.codingmilitia.com/2018/04/15/dotnetifying-grpc/ Very likely over-engineered PoC on making development of gRPC service development more dotnetish. [Redirect Magazine] #6 - Code reviews, side projects, functions as dependencies and performance profiling https://blog.codingmilitia.com/2018/04/15/redirect-magazine-0006-code-reviews-side-projects-function-dependencies-perf-profiling/ Sun, 15 Apr 2018 10:00:00 +0100 https://blog.codingmilitia.com/2018/04/15/redirect-magazine-0006-code-reviews-side-projects-function-dependencies-perf-profiling/ <p>This week has been a little slower, but I still have some nice stuff to share while I&rsquo;m finishing up a post on a little PoC I did with gRPC (code <a href="https://github.com/CodingMilitia/Grpc">here</a>).</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://dev.to/samipietikainen/why-junior-devs-should-review-seniors-commits-feb">&ldquo;Why junior devs should review seniors&rsquo; commits&rdquo;</a></h2> <p>Some good reasons for all developers to be involved in the code review process, not just the senior ones. <br/></p> <h2 id="heading-1"><a href="https://dev.to/theobendixson/what-does-a-good-side-project-look-like-1nof">&ldquo;What does a good side project look like?&rdquo;</a></h2> <p>While I disagree that one <strong>must</strong> have side projects, if there&rsquo;s interest in having one, these article talks about some of the possible benefits of it. <br/></p> [Redirect Magazine] #5 - Repository pattern diverging opinion, .NET and Go concurrency, JS Event Loop and Zones https://blog.codingmilitia.com/2018/04/08/redirect-magazine-0005-repository-pattern-dotnet-go-concurrency-js-eventloop-zones/ Sun, 08 Apr 2018 11:00:00 +0100 https://blog.codingmilitia.com/2018/04/08/redirect-magazine-0005-repository-pattern-dotnet-go-concurrency-js-eventloop-zones/ <p>Some more reading/watching material. A bit more Go this week, as I would love to use it to build something but haven&rsquo;t got around to do it - my attention span in pet projects is terrible, I start one thing then get another idea and forget the previous :)</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.thereformedprogrammer.net/is-the-repository-pattern-useful-with-entity-framework-core/">&ldquo;Is the repository pattern useful with Entity Framework Core?&rdquo;</a></h2> <p>An alternative point of view on the much used repository pattern. <br/></p> [Redirect Magazine] #4 - CLI tools, coding ASP.NET Core on Linux, actors and some more perf stuff https://blog.codingmilitia.com/2018/04/01/redirect-magazine-0004-cli-tools-aspnetcore-linux-actors-perf/ Sun, 01 Apr 2018 09:00:00 +0100 https://blog.codingmilitia.com/2018/04/01/redirect-magazine-0004-cli-tools-aspnetcore-linux-actors-perf/ <p>Here comes another round of interesting reads/watches.</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.hanselman.com/blog/CommandLineTabCompletionForNETCoreCLIInPowerShellOrBash.aspx">&ldquo;Command line &ldquo;tab&rdquo; completion for .NET Core CLI in PowerShell or bash&rdquo;</a></h2> <p>Something I had no clue that existed:.NET command line autocomplete and static file server. <br/></p> <h2 id="heading-1"><a href="http://voidcanvas.com/javascript-array-evolution-performance/">&ldquo;Diving deep into JavaScript array – evolution &amp; performance &ldquo;</a></h2> <p>Some insights on the array performance in JavaScript. <br/></p> <h2 id="heading-2"><a href="https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/dataflow-task-parallel-library">&ldquo;Dataflow (Task Parallel Library)&rdquo;</a></h2> <p>I had no clue there was an actor model like API tied into the TPL. Always nice to find out (even if years late). <br/></p> [Redirect Magazine] #3 - DDD with EF Core, ASP.NET Core, JS and .NET perf and some logging bits https://blog.codingmilitia.com/2018/03/25/redirect-magazine-0003-ddd-efcore-aspnetcore-value-types-js-log-perf/ Sun, 25 Mar 2018 11:00:00 +0100 https://blog.codingmilitia.com/2018/03/25/redirect-magazine-0003-ddd-efcore-aspnetcore-value-types-js-log-perf/ <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://www.thereformedprogrammer.net/creating-domain-driven-design-entity-classes-with-entity-framework-core/">&ldquo;Creating Domain-Driven Design entity classes with Entity Framework Core&rdquo;</a></h2> <p>Nice approach to implement domain driven design entity classes using EF Core. Some prior ideas on DDD might help in better understanding the article, but at very least it might pique your interest in learning more about it. <br/></p> <h2 id="heading-1"><a href="https://andrewlock.net/exploring-the-microsoft-aspnetcore-app-shared-framework-in-asp-net-core-2-1-preview-1/">&ldquo;Exploring the Microsoft.AspNetCore.App shared framework in ASP.NET Core 2.1 (preview 1)&rdquo;</a></h2> <p>Overview of the way an ASP.NET Core application dependencies are handled, and the changes introduced from 2.0 to 2.1. <br/></p> [Redirect Magazine] #2 - Stack Overflow developer survey, general tips, code reviews and some other stuff https://blog.codingmilitia.com/2018/03/18/redirect-magazine-0002-stack-overflow-developer-survey-general-tips-code-reviews-other-stuff/ Sun, 18 Mar 2018 10:00:00 +0000 https://blog.codingmilitia.com/2018/03/18/redirect-magazine-0002-stack-overflow-developer-survey-general-tips-code-reviews-other-stuff/ <p>Here comes another round of (interesting?) links!</p> <h1 id="articles">Articles</h1> <h2 id="heading"><a href="https://insights.stackoverflow.com/survey/2018/">&ldquo;Stack Overflow Developer Survey Results 2018&rdquo;</a></h2> <p>Always good to check out the state of our world. <br/></p> <h2 id="heading-1"><a href="https://blogs.msdn.microsoft.com/azureservicefabric/2018/03/14/service-fabric-is-going-open-source/">&ldquo;Service Fabric is going open source&rdquo;</a></h2> <p>I&rsquo;m sharing this not really for the content itself, which is not very thorough on the subject, but because we keep seeing this fundamental shift in Microsoft&rsquo;s strategy, making more and more stuff open source, and that&rsquo;s very cool! <br/></p> My couple of cents on remote work https://blog.codingmilitia.com/2018/03/15/my-couple-of-cents-on-remote-work/ Thu, 15 Mar 2018 21:45:00 +0000 https://blog.codingmilitia.com/2018/03/15/my-couple-of-cents-on-remote-work/ <p>Well, this is a very written about topic isn&rsquo;t it? I wasn&rsquo;t going to write about it, given the myriad of articles that already exist on the subject, but whilst watching the news today some extra ideas on it emerged and I thought, what the hell, I&rsquo;ll add one of my one to the never ending list.</p> <p>I&rsquo;m not going for a pros and cons approach, those were already written plenty of times. I just wanted to add some ideas that I seldom see associated to the topic.</p> [Redirect Magazine] #1 - Sharing some links https://blog.codingmilitia.com/2018/03/11/redirect-magazine-0001-sharing-some-links/ Sun, 11 Mar 2018 11:30:00 +0000 https://blog.codingmilitia.com/2018/03/11/redirect-magazine-0001-sharing-some-links/ <p>Haven&rsquo;t shared anything in a while, but that doesn&rsquo;t mean I&rsquo;m not up to something (I even recorded a video based on the <a href="https://blog.codingmilitia.com/2018/01/31/quick-intro-to-docker-and-docker-compose-angular-aspnetcore-postgres-app/">Docker + Angular + ASP.NET Core</a> post, but the sound turned out crappy and I scratched that).</p> <p>To try to avoid these times I don&rsquo;t share something I created, I thought of starting a (hopefully) weekly &ldquo;magazine&rdquo; linking to some stuff I&rsquo;ve been reading/watching.</p> <h2 id="articles">Articles</h2> <h3 id="heading"><a href="https://dev.to/sarah_chima/jpeg-gif-png-or-svg---which-should-i-use-1o8o">&ldquo;JPEG, GIF, PNG OR SVG - Which should You use?&rdquo;</a></h3> <p>Some guidance on image formats to use on your web app. <br/></p> Quick intro to Docker and Docker Compose: Angular, ASP.NET Core and Postgres app https://blog.codingmilitia.com/2018/01/31/quick-intro-to-docker-and-docker-compose-angular-aspnetcore-postgres-app/ Wed, 31 Jan 2018 19:30:00 +0000 https://blog.codingmilitia.com/2018/01/31/quick-intro-to-docker-and-docker-compose-angular-aspnetcore-postgres-app/ <h2 id="intro">Intro</h2> <p>I wanted to play a little with <a href="https://docs.docker.com/compose/">Docker Compose</a> so I created a little PoC that had the usual components of a web application: a frontend, a backend and a supporting database.</p> <p>Sample code to follow along <a href="https://github.com/joaofbantunes/AngularAspNetCoreDockerSample">here</a>.</p> <h2 id="sample-overview">Sample overview</h2> <p>As I was just looking for the simplest thing just to make all the bits work together, I whipped out a pretty stupid scenario. The application basically lists some counters and increments each one as it&rsquo;s selected.</p> [Video] Moving the blog to Jekyll and hosting on Netlify https://blog.codingmilitia.com/2018/01/29/video-moving-the-blog-to-jekyll-and-hosting-on-netlify/ Mon, 29 Jan 2018 22:00:00 +0000 https://blog.codingmilitia.com/2018/01/29/video-moving-the-blog-to-jekyll-and-hosting-on-netlify/ <p>Just added a new video, talking about the blog&rsquo;s move from WordPress (and all that infrastructure I talked about in <a href="https://blog.codingmilitia.com/2016/10/05/getting-this-up-and-running-intro">these series of posts</a>) to a static site, generated using <a href="https://jekyllrb.com/">Jekyll</a> and hosted using <a href="https://www.netlify.com/">Netlify</a>. <br/> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/VikNk5NZzPg?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <br/> A side note that I forgot to mention in the video: when using Jekyll, we need to set the environment variable <code>JEKYLL_ENV</code> to <code>production</code>, or stuff like Google Analytics and Disqus comments won&rsquo;t work, as it&rsquo;s disabled by default unless we&rsquo;re in production. Next you can see a screenshot of the Netlify screen where we can set environment variables. <br/> <br/> <a href="https://blog.codingmilitia.com/images/2018/01/29/00-netlify-environment-variables.jpg" target="_blank" rel="noopener"> <img srcset=" /images/2018/01/29/00-netlify-environment-variables_hu_43586cc4fa2ba3e0.webp 1024w, /images/2018/01/29/00-netlify-environment-variables_hu_79ffc56e8f106a8b.webp 512w" src="https://blog.codingmilitia.com/images/2018/01/29/00-netlify-environment-variables_hu_43586cc4fa2ba3e0.webp" alt="Setting environment variables on Netlify" loading="lazy"> </a> </p> A way to simplify unit tests on static methods https://blog.codingmilitia.com/2017/09/14/a-way-to-simplify-unit-tests-on-static-methods/ Thu, 14 Sep 2017 18:08:49 +0000 https://blog.codingmilitia.com/2017/09/14/a-way-to-simplify-unit-tests-on-static-methods/ <h2 id="intro">Intro</h2> <p>This post will be simple and try to act as a discussion starter on unit testing static methods.</p> <p>I&rsquo;m not the greatest fan of making static stuff, mainly because I&rsquo;ve been burned by it in the past (the fact is that static was being used badly in those cases, but even so, if I can, I&rsquo;ll avoid it) but I understand it&rsquo;s the best way to do things sometimes.</p> [Video] .NET performance curiosities https://blog.codingmilitia.com/2017/09/11/video-dotnet-performance-curiosities/ Mon, 11 Sep 2017 19:31:43 +0000 https://blog.codingmilitia.com/2017/09/11/video-dotnet-performance-curiosities/ <p>I added a new video, just talking about very simple stuff we do all the time that can have some impact on our applications performance, and the just as simple ways we can avoid these situations.</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/w2dIePAoEOs?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <p>The source code for the sample is here at <a href="https://github.com/joaofbantunes/DotNetPerfCuriositiesSample">GitHub</a></p> [Video] Using Polly to improve .NET applications resilience https://blog.codingmilitia.com/2017/07/29/video-using-polly-to-improve-net-applications-resilience/ Sat, 29 Jul 2017 15:38:16 +0000 https://blog.codingmilitia.com/2017/07/29/video-using-polly-to-improve-net-applications-resilience/ <p>I added a new video, this time revisiting the subject of a past post: using the Polly library to handle errors and improve application resiliency.</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/wBZmdx-5-Cs?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <p>The original post is <a href="https://blog.codingmilitia.com/2016/11/08/simpler-error-handling-in-net-applications-using-polly/">here</a> and you can check out the source code here on <a href="https://github.com/joaofbantunes/PollySample">GitHub</a>.</p> <p>Cyaz</p> [Video] REST vs GRPC in C# just for fun https://blog.codingmilitia.com/2017/07/17/video-rest-vs-grpc-in-c-just-for-fun/ Mon, 17 Jul 2017 19:51:18 +0000 https://blog.codingmilitia.com/2017/07/17/video-rest-vs-grpc-in-c-just-for-fun/ <p>I haven&rsquo;t posted in a while and today I felt like doing something different: a video!</p> <p>I have no clue if this will turn out any good so, check it out and make sure to provide some feedback!</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/IknwHZV19HA?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe> </div> <p>You can check out the source code here on <a href="https://github.com/joaofbantunes/RestVsGrpcSample">GitHub</a>.</p> [Redirect] How To Save The Princess In 8 Programming Languages https://blog.codingmilitia.com/2016/11/12/redirect-how-to-save-the-princess-in-8-programming-languages/ Sat, 12 Nov 2016 13:23:20 +0000 https://blog.codingmilitia.com/2016/11/12/redirect-how-to-save-the-princess-in-8-programming-languages/ <p>This is just too good not to share :)</p> <h2 id="original"><a href="https://toggl.com/programming-princess">Original</a></h2> <p><a href="https://toggl.com/programming-princess"><img alt="How To Save The Princess In 8 Programming Languages" loading="lazy" src="https://public-assets.toggl.space/b/static/cc33ee8fee212b5a140d6a233e5d6e6b/c3b35/article-toggl-how-to-save-the-princess-in-8-programming-languages.avif"></a></p> Simpler error handling in .NET applications using Polly https://blog.codingmilitia.com/2016/11/08/simpler-error-handling-in-net-applications-using-polly/ Tue, 08 Nov 2016 17:10:40 +0000 https://blog.codingmilitia.com/2016/11/08/simpler-error-handling-in-net-applications-using-polly/ <p>Just think how many times you had to write some code to handle errors, and that handling required more than just logging and proceed with life as if nothing happened. If retries are required, or a cool down time, that&rsquo;s a good amount of logic to roll for those situations. Well, there&rsquo;s a NuGet for that (I guess that&rsquo;s our version of there&rsquo;s an app for that).</p> <p><a href="https://github.com/App-vNext/Polly">Polly</a> is a &ldquo;library that allows developers to express transient exception and fault handling policies such as Retry, Retry Forever, Wait and Retry, or Circuit Breaker in a fluent manner.&rdquo;</p> Boilerplate hunting with Castle DynamicProxy https://blog.codingmilitia.com/2016/11/01/boilerplate-hunting-with-castle-dynamicproxy/ Tue, 01 Nov 2016 18:29:00 +0000 https://blog.codingmilitia.com/2016/11/01/boilerplate-hunting-with-castle-dynamicproxy/ <p><a href="https://github.com/castleproject/Core">Castle Core</a> is a library that provides some utilities but I&rsquo;ll just talk about using one of them, the DynamicProxy. If the post on <a href="https://blog.codingmilitia.com/2016/10/24/benchmarkdotnet/">BenchmarkDotNet</a> Ā was in the race for golden shovel award, a post on Castle DynamicProxy is a sure winner, but I feel like it :)</p> <p>Castle DynamicProxy is aĀ a &ldquo;lightweight runtime proxy generator&rdquo;, that enables you to do a kind ofĀ <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming">aspect oriented programming</a>, allowing for some code to be executed before or after a method is invoked on a proxied interface. It&rsquo;s useful for some cases, and I&rsquo;ll talk about two of such cases: caching and timing operation execution times. We could also do this using for example decorators, implementing the same interface of the target class. The problem with the decorator approach is that we need to implement all the operations one by one, but with the DynamicProxy approach we canĀ apply the same logic to all operations as long as it&rsquo;s sufficiently generic.</p> [Redirect] How you should (not) use HttpClient https://blog.codingmilitia.com/2016/10/27/redirect-how-you-should-not-use-httpclient/ Thu, 27 Oct 2016 21:24:18 +0000 https://blog.codingmilitia.com/2016/10/27/redirect-how-you-should-not-use-httpclient/ <p>(The redirect tag in the title means this post is justĀ a share of another post)</p> <p>So, how do you use the HttpClient (.NET)? Like this?</p> <div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"> <table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;"> <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1 </span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2 </span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3 </span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4 </span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5 </span></code></pre></td> <td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%"> <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">using</span> (<span style="color:#66d9ef">var</span> client = <span style="color:#66d9ef">new</span> HttpClient()) </span></span><span style="display:flex;"><span>{ </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">var</span> result = <span style="color:#66d9ef">await</span> client.GetAsync(<span style="color:#e6db74">&#34;http://xpto.com/api/stuff&#34;</span>); </span></span><span style="display:flex;"><span> <span style="color:#75715e">//...</span> </span></span><span style="display:flex;"><span>} </span></span></code></pre></td></tr></table> </div> </div><p>Well, so do I. And it&rsquo;s <strong>wrong</strong>.</p> <p>Check out <a href="http://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/">this article</a> that tells you all about why. tl;dr Use a singleton instance. Oh, and after that one, <a href="http://byterot.blogspot.pt/2016/07/singleton-httpclient-dns.html">this</a> is also a good (important) related read. (You&rsquo;ll see that this second article makes my tl;dr a bit too short)</p> BenchmarkDotNet - Library for benchmarking .NET code https://blog.codingmilitia.com/2016/10/24/benchmarkdotnet/ Mon, 24 Oct 2016 08:37:46 +0000 https://blog.codingmilitia.com/2016/10/24/benchmarkdotnet/ <p>This will probably earn me what some friends of mine call a golden shovel (an award for finding out something everyone already knows) but since I just recently found out about it, I&rsquo;ll write about it anyway.</p> <p>Several times I felt the need to benchmark someĀ portions of code so I could see if a way of doing somethingĀ could be a slow down cause for an application (many of those times were when I wanted to use some reflection to simplify the code and some colleagues were afraid reflection was going to have a negative impact on performance). When I wanted to do that, I just wrote aĀ consoleĀ application, throw a bunch ofĀ <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch">Stopwatches </a>around and put a loopĀ around the code I wanted to test to get an average execution time.</p> Getting this up and running – Bonus round: SSL, Email and stuff (3/3) https://blog.codingmilitia.com/2016/10/18/getting-this-up-and-running-bonus-round-ssl-email-and-stuff-3-3/ Tue, 18 Oct 2016 08:32:37 +0000 https://blog.codingmilitia.com/2016/10/18/getting-this-up-and-running-bonus-round-ssl-email-and-stuff-3-3/ <p>ToĀ finish up this series of posts I&rsquo;ll just go by a couple of extra things I needed to do to get the, mostly functional by now, site to work better.</p> <p>The main points are:</p> <ul> <li> <p>Getting some certificates to get the site working on https.</p> </li> <li> <p>Using a mail server to overcome an issue with WordPress running on Docker.</p> </li> </ul> <h2 id="get-the-site-onhttps">Get the site onĀ HTTPS</h2> <p>Everybody likes (or should) when you go to a web site and it uses HTTPS, even more so when there are private stuff going down the wire (like user credentials).</p> Getting this up and running – Installing Docker and running applications with it (2/3) https://blog.codingmilitia.com/2016/10/15/getting-this-up-and-running-installing-docker-and-running-applications-with-it-2-3/ Sat, 15 Oct 2016 08:12:28 +0000 https://blog.codingmilitia.com/2016/10/15/getting-this-up-and-running-installing-docker-and-running-applications-with-it-2-3/ <p>This post will focus on installing the Docker engine and then running the applications we need to make the blog work as Docker containers.</p> <p>I&rsquo;m not the best to explain all about Docker, so I&rsquo;ll focus on what I needed to do to get the blog running. If you really want to learn about Docker there are lots of good resources out there, starting with Docker&rsquo;s own <a href="https://docs.docker.com/">documentation</a>Ā (which I used a lot).</p> Getting this up and running – Initial server setup (1/3) https://blog.codingmilitia.com/2016/10/08/getting-this-up-and-running-initial-server-setup-1-3/ Sat, 08 Oct 2016 15:23:32 +0000 https://blog.codingmilitia.com/2016/10/08/getting-this-up-and-running-initial-server-setup-1-3/ <p>So this post is gonna be more of a &ldquo;getting started with a virtual machineĀ in a cloud provider&rdquo; sort of thing, not very advanced, just a simple step by step guide for someone who never did it.</p> <h2 id="cloud-providers">Cloud Providers</h2> <p>Like I said in the intro to this series of posts, I&rsquo;m using Linode mainly for it being slightly cheaper thanĀ Digital Ocean (referred as DO from now on) which I was using before it. Until this point both options seem to be really solid, although I haven&rsquo;t deployed nothing yet to really test how it performs under load.</p> Getting this up and running - Intro https://blog.codingmilitia.com/2016/10/05/getting-this-up-and-running-intro/ Wed, 05 Oct 2016 11:08:21 +0000 https://blog.codingmilitia.com/2016/10/05/getting-this-up-and-running-intro/ <p>So I guess a good article to begin withĀ would be to explain how I got this site up.</p> <p>Even more fitting is it has nothing to do with .NET, which you would expect would be on the debut article around this parts (rest assured those will come like a stampede :) ).</p> <p>So, let me start by summarize how this thing is working:</p> <ul> <li> <p>The server is a Linode [1] virtual machine. I was on Digital Ocean [2], but for 10$, I get 2GB of ram on Linode versus 1GB on Digital Ocean, and ram is very much appreciated so I can put lots of stuff running at the same time.</p> "Time's up, let's do this! Leeeeeeeeeeeeeroy Jenkins!" https://blog.codingmilitia.com/2016/10/03/times-up-lets-do-this-leeeeeeeeeeeeeroy-jenkins/ Mon, 03 Oct 2016 21:19:42 +0000 https://blog.codingmilitia.com/2016/10/03/times-up-lets-do-this-leeeeeeeeeeeeeroy-jenkins/ <p>And with this legendary quote [1]Ā , I open the hostilities in this new blog.</p> <p>I&rsquo;ve been thinking about creating something like this for a while, but the thought that probably I didn&rsquo;t have much to add to the myriad of coding blogs and sites out there, and maybe a tad of laziness, has delayed me for a couple of years.</p> <p>My main goal isĀ to talk about specific problems I had and how I solved them. I&rsquo;m sure most of the timesĀ I&rsquo;ll post something seen elsewhere, but adjusted to my particular problems. Hopefully sometimes I can come out with somethingĀ that&rsquo;s not that easy to find through the <em>interwebs</em>. In summary, it&rsquo;ll be like a log of some of the stuff I do, so I can get back to it later and maybe assist someone in the process (and probably learn from someone who chimes in to improve myĀ shenanigans).</p> Contact https://blog.codingmilitia.com/contact/ Mon, 01 Jan 0001 00:00:00 +0000 https://blog.codingmilitia.com/contact/ <p>If you can&rsquo;t get in touch through one of the channels listed in the footer, feel free to use this form.</p> <p>I&rsquo;ll try to get back to you as soon as possible.</p> <form name="contact" method="POST" data-netlify="true" netlify-honeypot="bot-field"> <div class="honeypot-hidden"> <label>Don’t fill this out if you're human: <input name="bot-field" /></label> </div> <div class="field"> <label class="label">Your Name:</label> <input type="text" name="name" class="input" /> </div> <div class="field"> <label class="label">Your Email:</label> <input type="email" name="email" class="input" /> </div> <div class="field"> <label class="label">Message:</label> <textarea name="message" class="textarea"></textarea> </div> <div class="control"> <button type="submit" class="button is-link">Send</button> </div> </form>