Category Archives: C#

Generating Files With Razor Engine

The Razor engine can be used outside of ASP.NET. Beside the cool syntax, it’s a very fast engine! And it’s quite easy to use. In my example I generate a XML file based on a razor template. (You have to install the NuGet package “RazorEngine”. This is my model which I use for the rendering:… Read More »

Demistifying async/await

Microsoft introduced new keywords in C# 5.0 for asynchronous programming. Before C# 5.0 async. programming was only possible with .NET Framework classes. Now it’s implemented in the C# language itself. Here is a simple demo which shows how the keywords can be used. public async Task<string> DownloadFromWeb() { var client = new HttpClient(); return await… Read More »