Teemablogi sissekanded


Building offline Blazor application

I made one small experiment and tried to get simple client-side Blazor application running on browser in offline mode. Yes, offline – visit application page once, turn out internet connection, open browser, type in application URL and it just runs. This blog post is short illustrated overview of my experiment. For this experiment I built simple beer calculator. 20:30 24.10.2018 kanalilt DT blogi 2


Server-side Blazor applications

Lately Blazor got important update – support for server-side Blazor applications. This blog post introduces how server-side Blazor applications work and what are pros and cons when considering building these. What is server-side Blazor application? By default Blazor applications run in browser and communicate with server-side API-s. All rendering and UI logic runs in browser. 08:14 19.10.2018 kanalilt DT blogi 2


String repeat method for C#

C# doesn’t have built-in function to repeat a string. There are different version for string. Repeat() available in internet and it’s up to reader to find out which version works better. Here is the list of most popular implementations I found across the web. I list my findings here with the results of simple performance test. String repeat implementations I found these six implementations to be. . . Source. 07:18 24.07.2018 kanalilt DT blogi 2


ASP. NET MVC error: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.

Error when running ASP. NET MVC application from Visual Studio: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Stop inventing painful hacks, solution is here. How to reproduce This is what I have to do to get this error in Visual. . . Source. 06:30 12.07.2018 kanalilt DT blogi 2


Adding search to Blazor applications

As my Blazor demo application supports now Azure AD I took the next step and implemented search using Azure Search service. This blog post shows how to add search capabilities to Blazor application using Azure AD protected Azure Functions back-end and Azure Search service. Source code available! Source code for my Blazor demo solution is available at my GitHub repository peipman/BlazorDemo. Feel. . . Source. 09:14 11.07.2018 kanalilt DT blogi 2


Azure AD authentication in Blazor using ADAL.js

Although Blazor is in early stages of development it is already good enough to try out and play with it. As a logical continuation to my previous experiment where I made Blazor application use Azure Functions based back-end I made it also support Azure AD authentication on web application and back-end level. This blog post introduces my work on Blazor and Azure AD. Source code available! Source. . . Source. 06:23 09.07.2018 kanalilt DT blogi 2


Running WordPress on .NET Core

About year ago I wrote a blog post Running PHP applications on . NET Core where I introduced how to build PHP applications to . NET Core using Peachpie. Their showcase was WordPress – the famous blog engine that also runs my blog. Peachpie guys have made significant work over year and they have reached the point where whole WordPress is built as . NET Core application. Why WordPress on . NET Core? As. . . Source. 07:53 05.07.2018 kanalilt DT blogi 2


Hosting Azure Functions backed Blazor application on Azure Storage static website

My previous blog post was an introduction to static website hosting on Azure Storage. This post focuses on how to deploy Blazor application as a Azure static website on Azure Storage and how to use Azure Functions as a server back-end for Blazor application hosted as a static site. Source code available! Source code for this blog post is available in my GitHub repository gpeipman/BlazorDemo. Feel. . . Source. 07:58 04.07.2018 kanalilt DT blogi 2


Introducing static website hosting for Azure Storage

Azure has new and interesting service for hosting static sites on blob storage. There is no additional server-side application hosting account needed to run public static sites – they run straight from blob storage. Although the service is in public preview, it is time to find out how it works and when we should consider using it. Why static sites? One can argue that static sites are history and. . . Source. 07:08 03.07.2018 kanalilt DT blogi 2


ASP.NET Core Identity scaffolding

ASP. NET Core 2. 1 introduces Razor UI class libraries that allow us to share UI artifacts with libraries and NuGet packages. One of first official packages delivered with UI pieces is ASP. NET Core Identity. This blog post shows how to override default views of ASP. NET Core Identity by using scaffolding. Let’s start with ASP. NET Core 2. 1 application that uses individual accounts for users. ASP. NET. . . Source. 07:25 27.06.2018 kanalilt DT blogi 2


Injecting services to ASP. NET Core controller actions.

ASP. NET Core comes with thin but rich and powerful built-in dependency injection mechanism we can use to inject instances to controllers and some other parts of web applications. Although constructor injection is the most famous dependency injection method for controllers there is also dependency injection to controller actions available. This post introduces controller action injection and shows. . . Source. 06:30 25.06.2018 kanalilt DT blogi 2


Solving Remote Desktop problems on Windows 10

Remote Desktop is great thing when it works but with Windows 10 I usually see one problem after another. I decided to write up some tricks I need pretty often when RDP is going crazy on some Windows 10 box. Nothing special but I hope I save some people hours of time on trying out different tricks found in internet. Full screen RDP shows local taskbar in foreground This is one of the most annoying. . . Source. 09:09 22.06.2018 kanalilt DT blogi 2


Running ASP. NET Core application as Windows service.

ASP. NET Core 2. 1 introduces new application host for Windows services. We can now run ASP. NET Core applications as Windows services with minimal effort. This blog post introduces how it is done and how to build and run Windows services on ASP. NET Core without any need for dirty hacks. Creating default web application We start with new default ASP. NET Core 2. 1 web application. I don’t configure. . . Source. 07:20 20.06.2018 kanalilt DT blogi 2


Database level grouping in Entity Framework Core 2.

Previous versions of Entity Framework Core doesn’t support database level grouping and LINQ GroupBy is translated locally. Entity Framework Core 2. 1 translates LINQ GroupBy to database query in most of cases. Here is the example. To illustrate GroupBy translation I’m using database and some code from my multitenant ASP. NET Core sample solution. There is simple database with two entities not. . . Source. 07:52 19.06.2018 kanalilt DT blogi 2


Adding attribute to backing field of automated property

There are scenarios where developers want to add attributes to backing field of automated property. It was hard to do before C# 7. 3. Now it is supported in Visual Studio and solution is simple. This blog post shows how to add attribute to backing field of automated property. Suppose we have a class with automated property and we want to apply some attribute to backing field of this property. Also. . . Source. 06:11 18.06.2018 kanalilt DT blogi 2


Speaking at ITCamp 2018

Today and tomorrow I have honor to be a speaker at ITCamp 2018 at Cluj-Napoca, Romania. It is pretty big conference at Romania and I’m happy to see serious line-up of speakers and well organized event. Here is short overview of muy presentations at ITCamp 2018. I have two presentations: 07. 06 16:45 – Deep dive to C# 7This presentation is about new features in different versions of C# 7. I will. . . Source. 15:30 07.06.2018 kanalilt DT blogi 2

GDPR features in ASP.NET Core

As General Data Protection Regulation (GDPR) is now official in European Union (EU) there’s also some basic support for it included in ASP. NET Core 2. 1. Althouhg it’s not possible to come out with technical etalon for GDPR there’s still some good starting points available in ASP. NET Core. Here is the brief overview. Consent for non-essential cookies First GDPR thing we notice with ASP. NET Core. . . Source. 08:28 07.06.2018 kanalilt DT blogi 2


Include for derived types in Entity Framework 2.1

When I wrote user interface for my TemperatureStation solution I faced some bad problems with Entity Framework Core when trying to query base type and get some navigation properties of derived types included. I was able to come out with some work-arounds that were far from being satisfying for me. Include for derived types in Entity Framework Core solves the problem. Problem Suppose we have some. . . Source. 05:33 06.06.2018 kanalilt DT blogi 2


Razor Class Library with ASP.NET Core MVC

ASP. NET Core 2. 1 introduces Razor Class Library (RCL). It’s the new way how to share reusable web application components with UI as dependent project or NuGet package. As public examples mostly cover how it works with Razor Pages, I decided to write this blog post and demo application for ASP. NET Core MVC. Source code available! I created demo application that shows all stuff written here. Feel. . . Source. 06:17 05.06.2018 kanalilt DT blogi 2


Pattern matching in switch statements

One of new features introduced by C# 7. 0 is support for pattern matching in switch statements. It’s like mix of switch and if statements so we don’t have to nest these two. This blog post introduces pattern matching in switch statements and shows what C# compiler produces of switch statements. Let’s take a look at the following switch statement that introduces new concepts. public static void. . . Source. 04:13 04.06.2018 kanalilt DT blogi 2