Xiaodi Yan's Blog

Coding is fun...

In part 1 of this article - Using Azure Devops Pipelines to inject configurations for Asp.Net Core Aeb App on linux, I used Azure DevOps to deploy my ASP.NET Core app to Azure Web App on Linux. The next part is to publish the same web app to Azure Web Apps for Containers. I do not need to re-emphasize the benefits of the container. You can find bunches of documents that promote it. So I just would like to show you how to leverage the Azure DevOps Pipelines to build the web app as docker images then push it to Azure Container Registry, then publish it to Azure Web Apps for Containers.

Read more »

For some reason, I found an interesting project - GildedRose-Refactoring-Kata on GitHub. It provides a starting code for refactoring exercise in a bunch of programming languages. The principle is we should create enough unit tests that can cover all cases(especially for the edge cases), then start to refactor the code. Let us try to do some exercises.

Read more »

With EntityFramework Core, we can use attributes or Fluent API to config the model mappings. One day I just got a scenario that needs a new mapping style. There is a system that generates lots of data every day and it needs to store the data per table per day. For example, the database looks like:

Read more »

Translator Helper is a VS Code Extension to help you translate documents. It is easy to use. Just press Alt+T. The text will be automatically translated to another language and inserted after the current text as expected.

Introduction

Microsoft Docs is the new generation of Microsoft’s tech documentation to replace MSDN. It provides bunches of tutorials, API reference, code examples and best practices for users, developers and IT professionals. But for non-English users, one issue is some documents are translated by machines without proofreading, which means the readability is not good enough.

Read more »

Welcome to my blog!

1
2
var greeting = "Hello World!";
Console.WriteLine(greeting);

I have got used to configure Azure DevOps Pipelines with the classic editor that allows us to configure lots of properties of the tasks with a friendly user interface. But the better way to configure the Pipelines is by using YAML file. It is easy to fine-tune each option for your Pipeline, and easy to clone & share. That is why YAML is the default Pipelines configuration template in Azure DevOps nowadays. I have developed a simple NuGet package that integrates Azure DevOps to build and publish. I will demonstrate how to create a new pipeline with YAML file. Before we get started, let us spend several minutes to gain a basic understanding of YAML.

Read more »

The original requirement is that I need to develop a WPF application which implements the socket sender/receiver. First, I created a basic WPF application with MVVM pattern. Then I made a single project to do all the stuff related to socket communication. Next I have to integrate the socket library into the ViewModel project to operate socket connections.

Obviously, we can use event for this purpose. For example, we could have a class named SocketServer that has an event to receive socket packages, then subscribe to it in the ViewModel layer. But that means we have to create the instance of the SocketServerclass, which couples the ViewModel layer with the socket project. I hope to create a mediator to decouple them. So the publisher and subscriber do not need to know each other.

Read more »
0%