Local AI Models in .NET

Run Local AI Models in .NET Like a Boss

You know that you don’t need to pay for AI services to get the job done, right? If you’re looking to run local AI models in your .NET applications, I’ve got just the thing for you. In this post, I walk you through how to set up and run local AI models using .NET, Docker, and Ollama. We’ll cover everything from installing the necessary tools to running your first model, and to building a simple application that uses these models. ...

August 6, 2025 · 5 min · Mohamad Dbouk
HybridCache in .NET 9

HybridCache in .NET 9 is Awesome!

.NET 9 is now live, and it comes with a new set of features. Some are great, and some are just icing on the cake. But what really stands out is the new HybridCache! HybridCache is not just another caching API in .NET; it’s designed to solve problems we didn’t even know we had. It combines the best of two worlds by bridging the gap between IMemoryCache and IDistributedCache. It also introduces advanced features like cache stampede protection and efficient serialization. ...

November 23, 2024 · 3 min · Mohamad Dbouk
Bringing Blazor to Desktop and Mobile with MAUI

Bringing Blazor to Desktop and Mobile with MAUI

I wanted to host a Blazor WebAssembly application natively as a desktop application, and to achieve that, I planned to use a MAUI Blazor app. However, I wanted to avoid duplicating the Razor pages between both of my projects since I intended to continue using the web version as well. In this blog post, I will show you how to accomplish this. Consider using this approach to host your SaaS application in the cloud and simultaneously offer support for a native desktop app, much like Slack. ...

September 24, 2023 · 6 min · Mohamad Dbouk
Tic Tac Toe Game with Blazor WebAssembly

Let's Build a Tic Tac Toe Game with Blazor WebAssembly!

Hey there, fellow developer! In this tutorial, I’ll walk you through building an awesome Tic Tac Toe game using Blazor WebAssembly. So grab your coding gear, and let’s get started! To check the full source code, you can visit github/mhdbouk/tictactoe-blazor. Step 1: Set Up the Blazor WebAssembly Project First things first, we need to set up a new Blazor WebAssembly project. Do your thing with the command line or your favorite IDE like Visual Studio or Visual Studio Code. Get that project ready for some Tic Tac Toe action! ...

August 29, 2023 · 9 min · Mohamad Dbouk
Mapperly Logo

Mapperly: The Coolest Object Mapping Tool in Town

Hey there, developers! Today I want to talk about an astonishing .NET library called Mapperly, which has been gaining much attention in the developer community. Mapperly is a powerful source generator that simplifies the implementation of object-to-object mappings in .NET applications. Mapperly takes mapping to a whole new level by generating mapping code for you based on the mapping method signatures you define. If you’re tired of writing repetitive mapping code and seeking a seamless solution to simplify object mappings in your .NET projects, Mapperly is the answer you’ve been waiting for. Join me in this blog post to learn more! ...

July 13, 2023 · 5 min · Mohamad Dbouk
NuGet Unauthorized Access Issue

How to Resolve Unauthorized Access Issue with Private NuGet Repository

Have you ever encountered an issue while trying to restore packages from a private NuGet repository in JetBrains Rider using Azure DevOps? I recently faced a similar problem and struggled with the “401 Unauthorized” error. In this blog post, I will guide you through the steps I took to fix this issue. So, let’s dive in! Azure DevOps and Private NuGet Repositories Azure DevOps is a comprehensive platform that provides a range of tools for software development, including package management with NuGet. Private NuGet repositories in Azure DevOps allow you to host and manage your own packages. You may encounter authentication challenges when you try to restore packages from a private NuGet repository. ...

June 12, 2023 · 4 min · Mohamad Dbouk
Spectre.Console Logo

How to create beautiful console applications with Spectre.Console

Hey there friends! If you are a .NET developer who loves to create console applications, you might have wondered how to make them more appealing and user-friendly. Sure, you can use Console.WriteLine and Console.ReadLine to output some text and get some input, but that’s pretty boring and limited. What if you want to display some colors, styles, tables, trees, progress bars, or even ASCII images? What if you want to parse command-line arguments and create complex commands like git, npm, or dotnet? ...

March 19, 2023 · 6 min · Mohamad Dbouk
Integration Testing and Minimal API in .Net 7

Say Hello to Reliable Minimal APIs with Integration Tests

Hi there! Integration testing is an important part of the software development process because it helps ensure that your APIs are working correctly and returning the expected result. Unfortunately, many people often mix up integration tests with mock testing and use mock for integration tests. This can lead to issues when testing APIs, as mock tests don’t provide a complete picture of how your code will behave in a real-world scenario. ...

January 8, 2023 · 7 min · Mohamad Dbouk
You no longer need a Dockerfile

You no longer need a Dockerfile

The .Net 7 release is bringing a lot of changes, and one of the most significant is the removal of the need for a Dockerfile. Container images are now a supported output type of the .NET SDK. You no longer need a separate Dockerfile to containerize your .NET applications. You can publish your application and it will be built into a container image. This is a significant improvement for .NET developers who want to containerize their applications. It will make it much easier to distribute and run your applications in the cloud. In this article, we’ll take a look at what this change means for you and your applications. ...

December 4, 2022 · 5 min · Mohamad Dbouk
NSubstitute Logo

How to Mock using NSubstitute

Unit tests are code written to test small pieces of functionality of big programs. Performing unit tests is always designed to be simple, A “UNIT” in this sense is the smallest component of the large code part that makes sense to test, mainly a method out of many methods of some class. Unit tests take milliseconds, can be run at the press of a button, and don’t necessarily require any knowledge of the system at large. And when writing unit tests, you need to focus on the UNIT at hand and not consider other dependencies like services or variables. To accomplish that we need to use mocking. There are many Mocking frameworks out there, but today we will check NSubstitute. ...

November 4, 2022 · 2 min · Mohamad Dbouk