.NET News & What's New for Kontent in .NET
Tags: dotnet, blazor, azure, kenticokontent
Published: 2020-05-26 16:26:56

---
title: .NET News & What's New for Kontent in .NET
published: true
date: 2020-05-25 13:29:04 UTC
tags: dotnet, blazor, azure, kenticokontent
canonical_url: https://www.mcbeev.com/Blog/May-2020/Net-5-News-Kentico-Kontent
---

It's May, and the means that many things in the US. People are looking forward to Memorial day, the opening of summer, the welcoming of warm weather, the end of the stay at home orders (unless you are in Michigan), and plenty more. However, it also means that the biggest event of the year is here if you are a .Net developer, that's right the annual [Microsoft Build conference](https://mybuild.microsoft.com/).

MS Build 2020 happened last week, with a new virtual only format, and with tons of new announcements as it always does. For .Net developers who weren't paying attention the biggest announcements being **Blazor WebAssembly** has officially made it to its first production release, **Azure Static Web Apps** preview, **.Net 5 preview 4** is out, the unveiling of **.NET Multi-platform App UI (MAUI)**, **C# 9.0**, **Windows Forms Designer for .Net Core**, a **Microsoft Bot Framework** update, and updates to our favorite developer tools like **Visual Studio** and **Code**. Honesty, there is a ton more as well. 

With the announcement of so many cool .Net things, it got me thinking, how could **Kentico Kontent** developers take advantage of these new things, and also what else is new or updated in the Kontent world for .Net projects and solutions. The rest of this post is where I will cover that very thing, plus mention how we might be able to take advantage of the latest and greatest from MS Build 2020 as well.

### Blazor WebAssembly is Ready for Prime Time

A year or two ago when **[Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor)** was first introduced as an idea, people (including me) weren't so sure if it was  going to be a viable tool to meet the promise of "write C# to create a JavaScript based SPA application". Well fast forward in time to last week, and Microsoft and the Blazor team has done its best to turn this idea into reality.

I've got some first hand experience with Blazor's previous preview build. It at first really reminded me of web forms 2.0 coding, but only at first. As I have used it more, I have started to understand more of it's power and started to come around a little more to it. The biggest changes with the production ready release that happened this week are the fact that the overall payload size is much smaller in terms of overall download size to the client, adding in the ability to do Authentication based on the OAuth 2.0 protocol via OpenID Connect, native support for Progressive Web Applications (PWTs), enhanced Debugging capabilities, and finally the ability to auto-rebuild in Visual Studio (to eventually support hot reloading of Blazor Wasm projects).

[Blazor WebAssembly](https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-now-available/) (or Blazor Wasm for the cool kids) may turn out to be a big part of every .Net developer's future, as well as, a big part of the workload for Kentico developers too. I would keep an eye on it if you haven't.

### Kentico Kontent and Blazor WebAssembly

If you are reading this post, you may be wondering how can I start working with Kontent and Blazor. Well, I happen to have talked about using Kontent to ready and write data in one of my most recent [Kentico Rocks Podcast episode about the **Kontent Management API**](https://www.mcbeev.com/Blog/March-2020/Kentico-Rocks-Podcast-Episode-31). During that podcast you can see my Blazor prototype project I created for building a CrossFit Rowling app. The app connects to the Kontent Delivery API to get its content for the teams, scoring system, and team logos. Luckily the Kontent Delivery SDK can be plugged into the standard Blazor project template fairly easily. 

Basically you can create a service that uses the DeliveryClient from the [Kontent Delivery SDK for .Net](https://github.com/Kentico/kontent-delivery-sdk-net).

<pre style="font-family:Consolas;font-size:13px;color:#dadada;background:#1e1e1e;"><span style="color:#569cd6;">public</span> <span style="color:#569cd6;">class</span> <span style="color:#4ec9b0;">KontentDeliveryService</span>
<span style="color:gainsboro;">{</span>        
    <span style="color:#569cd6;">private</span> <span style="color:#b8d7a3;">IConfiguration</span> <span style="color:gainsboro;">_configuration</span><span style="color:gainsboro;">;</span>
    <span style="color:#569cd6;">private</span> <span style="color:#4ec9b0;">HttpClient</span> <span style="color:gainsboro;">_httpClient</span><span style="color:gainsboro;">;</span>
    <span style="color:#569cd6;">private</span> <span style="color:#b8d7a3;">ITypeProvider</span> <span style="color:gainsboro;">_typeProvider</span><span style="color:gainsboro;">;</span>
    <span style="color:#569cd6;">private</span> <span style="color:#b8d7a3;">IDeliveryClient</span> <span style="color:gainsboro;">_deliveryClient</span><span style="color:gainsboro;">;</span>

    <span style="color:#569cd6;">public</span> <span style="color:#4ec9b0;">KontentDeliveryService</span><span style="color:gainsboro;">(</span><span style="color:#b8d7a3;">IConfiguration</span> <span style="color:gainsboro;">configuration</span><span style="color:gainsboro;">,</span> <span style="color:#4ec9b0;">HttpClient</span> <span style="color:gainsboro;">httpClient</span><span style="color:gainsboro;">,</span> <span style="color:#b8d7a3;">ITypeProvider</span> <span style="color:gainsboro;">typeProvider</span><span style="color:gainsboro;">)</span>
    <span style="color:gainsboro;">{</span>
        <span style="color:gainsboro;">_configuration</span> <span style="color:#b4b4b4;">=</span> <span style="color:gainsboro;">configuration</span><span style="color:gainsboro;">;</span>
        <span style="color:gainsboro;">_httpClient</span> <span style="color:#b4b4b4;">=</span> <span style="color:gainsboro;">httpClient</span><span style="color:gainsboro;">;</span>
        <span style="color:gainsboro;">_typeProvider</span> <span style="color:#b4b4b4;">=</span> <span style="color:gainsboro;">typeProvider</span><span style="color:gainsboro;">;</span>
    <span style="color:gainsboro;">}</span>

    <span style="color:#569cd6;">public</span> <span style="color:#b8d7a3;">IDeliveryClient</span> <span style="color:gainsboro;">GetDeliveryClient</span><span style="color:gainsboro;">()</span>
    <span style="color:gainsboro;">{</span>
        <span style="color:#569cd6;">if</span> <span style="color:gainsboro;">(</span><span style="color:gainsboro;">_deliveryClient</span> <span style="color:#b4b4b4;">==</span> <span style="color:#569cd6;">null</span><span style="color:gainsboro;">)</span>
        <span style="color:gainsboro;">{</span>
            <span style="color:#569cd6;">var</span> <span style="color:gainsboro;">projectId</span> <span style="color:#b4b4b4;">=</span> <span style="color:gainsboro;">_configuration</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">GetValue</span><span style="color:gainsboro;"><</span><span style="color:#569cd6;">string</span><span style="color:gainsboro;">>(</span><span style="color:#d69d85;">"DeliveryOptions:ProjectId"</span><span style="color:gainsboro;">);</span>
            <span style="color:gainsboro;">_deliveryClient</span> <span style="color:#b4b4b4;">=</span> <span style="color:#4ec9b0;">DeliveryClientBuilder</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">WithProjectId</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">projectId</span><span style="color:gainsboro;">)</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">WithHttpClient</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">_httpClient</span><span style="color:gainsboro;">)</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">WithTypeProvider</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">_typeProvider</span><span style="color:gainsboro;">)</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">Build</span><span style="color:gainsboro;">();</span>
        <span style="color:gainsboro;">}</span>

        <span style="color:#569cd6;">return</span> <span style="color:gainsboro;">_deliveryClient</span><span style="color:gainsboro;">;</span>
    <span style="color:gainsboro;">}</span>
<span style="color:gainsboro;">}</span></pre>

Use that service to grab some content from the Delivery API via **GetItemsAsync**

<pre style="font-family:Consolas;font-size:13px;color:#dadada;background:#1e1e1e;"><span style="color:#569cd6;">public</span> <span style="color:#569cd6;">async</span> <span style="color:#4ec9b0;">Task</span><span style="color:gainsboro;"><</span><span style="color:#4ec9b0;">List</span><span style="color:gainsboro;"><</span><span style="color:#4ec9b0;">Team</span><span style="color:gainsboro;">>></span> <span style="color:gainsboro;">GetAllTeamsAsync</span><span style="color:gainsboro;">()</span>
<span style="color:gainsboro;">{</span>
    <span style="color:#569cd6;">if</span> <span style="color:gainsboro;">(</span><span style="color:gainsboro;">_allTeams</span> <span style="color:#b4b4b4;">==</span> <span style="color:#569cd6;">null</span><span style="color:gainsboro;">)</span>
    <span style="color:gainsboro;">{</span>
        <span style="color:gainsboro;">_allTeams</span> <span style="color:#b4b4b4;">=</span> <span style="color:#569cd6;">new</span> <span style="color:#4ec9b0;">List</span><span style="color:gainsboro;"><</span><span style="color:#4ec9b0;">Team</span><span style="color:gainsboro;">>();</span>

        <span style="color:#569cd6;">var</span> <span style="color:gainsboro;">data</span> <span style="color:#b4b4b4;">=</span> <span style="color:#569cd6;">await</span> <span style="color:gainsboro;">_deliveryService</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">GetDeliveryClient</span><span style="color:gainsboro;">()</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">GetItemsAsync</span><span style="color:gainsboro;"><</span><span style="color:gainsboro;">Models</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">Generated</span><span style="color:#b4b4b4;">.</span><span style="color:#4ec9b0;">Team</span><span style="color:gainsboro;">>();</span>

        <span style="color:gainsboro;">_allTeams</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">AddRange</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">data</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">Items</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">Select</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">item</span> <span style="color:#b4b4b4;">=></span> <span style="color:gainsboro;">MapTeam</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">item</span><span style="color:gainsboro;">)));</span>
    <span style="color:gainsboro;">}</span>
    <span style="color:#569cd6;">return</span> <span style="color:gainsboro;">_allTeams</span><span style="color:gainsboro;">;</span>
<span style="color:gainsboro;">}</span></pre>

And throw the content on your Blazor Component:

<pre style="font-family:Consolas;font-size:13px;color:#dadada;background:#1e1e1e;"><span style="color:black;background:#ffffb3;">@</span><span style="color:#569cd6;">if</span><span style="color:gainsboro;">(</span><span style="color:gainsboro;">Team</span> <span style="color:#b4b4b4;">==</span> <span style="color:#569cd6;">null</span><span style="color:gainsboro;">)</span>
<span style="color:gainsboro;">{</span>
    <span style="color:gray;"><</span><span style="color:#569cd6;">p</span><span style="color:gray;">><</span><span style="color:#569cd6;">em</span><span style="color:gray;">></span><span style="color:gainsboro">Loading...</span><span style="color:gray;"></</span><span style="color:#569cd6;">em</span><span style="color:gray;">></</span><span style="color:#569cd6;">p</span><span style="color:gray;">></span>
<span style="color:gainsboro;">}</span>
<span style="color:#569cd6;">else</span> 
<span style="color:gainsboro;">{</span>
    <span style="color:gray;"><</span><span style="color:#569cd6;">div</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"team-item"</span><span style="color:gray;">></span>
        <span style="color:gray;"><</span><span style="color:#569cd6;">a</span> <span style="color:#9cdcfe;">href</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"/teams/</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">CodeName</span><span style="color:#c8c8c8;">"</span><span style="color:gray;">></span>
            <span style="color:gray;"><</span><span style="color:#569cd6;">h2</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"font-weight-normal"</span><span style="color:gray;">></span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">TeamName</span><span style="color:gray;"></</span><span style="color:#569cd6;">h2</span><span style="color:gray;">></span>
            <span style="color:gray;"><</span><span style="color:#569cd6;">img</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"card-img"</span> <span style="color:#9cdcfe;">src</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">TeamLogo</span><span style="color:#c8c8c8;">"</span> <span style="color:#9cdcfe;">alt</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">TeamName</span><span style="color:#c8c8c8;"> logo"</span> <span style="color:gray;">/></span>
            <span style="color:black;background:#ffffb3;">@</span><span style="color:#569cd6;">if</span> <span style="color:gainsboro;">(</span><span style="color:#b4b4b4;">!</span><span style="color:gainsboro;">ReadOnly</span><span style="color:gainsboro;">)</span>
            <span style="color:gainsboro;">{</span>

                <span style="color:gray;"><</span><span style="color:#569cd6;">h3</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"card-title"</span><span style="color:gray;">></span>Current Score: <span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">TeamScore</span><span style="color:gray;"></</span><span style="color:#569cd6;">h3</span><span style="color:gray;">></span>
                <span style="color:gray;"><</span><span style="color:#569cd6;">span</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"team-current-frames-left"</span><span style="color:gray;">></span>Frames left: <span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">Team</span><span style="color:#b4b4b4;">.</span><span style="color:gainsboro;">TeamFramesLeft</span><span style="color:gray;"></</span><span style="color:#569cd6;">span</span><span style="color:gray;">></span>
            <span style="color:gray;"><</span><span style="color:#569cd6;">div</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"cta"</span><span style="color:gray;">></span>   
                <span style="color:gray;"><</span><span style="color:#569cd6;">button</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"btn btn-primary"</span> <span style="color:#9cdcfe;">role</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"button"</span> <span style="font-weight:bold;color:teal;background:#ffffb3;">@</span><span style="font-weight:bold;color:teal;">onclick</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span>(<span style="color:gainsboro;">()</span> <span style="color:#b4b4b4;">=></span> <span style="color:gainsboro;">IncrementScore</span><span style="color:gainsboro;">()</span>)<span style="color:#c8c8c8;">"</span> <span style="color:#9cdcfe;">disabled</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">IsDisabled</span><span style="color:#c8c8c8;">"</span><span style="color:gray;">><</span><span style="color:#569cd6;">span</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"oi oi-plus"</span><span style="color:gray;">></</span><span style="color:#569cd6;">span</span><span style="color:gray;">></span>  Add to Current Score<span style="color:gray;"></</span><span style="color:#569cd6;">button</span><span style="color:gray;">></span>
                <span style="color:gray;"><</span><span style="color:#569cd6;">button</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"btn btn-secondary"</span> <span style="color:#9cdcfe;">role</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"button"</span> <span style="font-weight:bold;color:teal;background:#ffffb3;">@</span><span style="font-weight:bold;color:teal;">onclick</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span>(<span style="color:gainsboro;">()</span> <span style="color:#b4b4b4;">=></span> <span style="color:gainsboro;">IncrementFrames</span><span style="color:gainsboro;">()</span>)<span style="color:#c8c8c8;">"</span> <span style="color:#9cdcfe;">disabled</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">IsDisabled</span><span style="color:#c8c8c8;">"</span><span style="color:gray;">><</span><span style="color:#569cd6;">span</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"oi oi-arrow-circle-right"</span><span style="color:gray;">></</span><span style="color:#569cd6;">span</span><span style="color:gray;">></span>  Go to Next Frame<span style="color:gray;"></</span><span style="color:#569cd6;">button</span><span style="color:gray;">></span>
                <span style="color:gray;"><</span><span style="color:#569cd6;">button</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"btn btn-link"</span> <span style="color:#9cdcfe;">role</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"button"</span> <span style="font-weight:bold;color:teal;background:#ffffb3;">@</span><span style="font-weight:bold;color:teal;">onclick</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span>(<span style="color:gainsboro;">()</span> <span style="color:#b4b4b4;">=></span> <span style="color:gainsboro;">ResetTeam</span><span style="color:gainsboro;">()</span>)<span style="color:#c8c8c8;">"</span> <span style="color:#9cdcfe;">disabled</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"</span><span style="color:black;background:#ffffb3;">@</span><span style="color:gainsboro;">IsDisabled</span><span style="color:#c8c8c8;">"</span><span style="color:gray;">><</span><span style="color:#569cd6;">span</span> <span style="color:#9cdcfe;">class</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">"oi oi-power-standby"</span><span style="color:gray;">></</span><span style="color:#569cd6;">span</span><span style="color:gray;">></span>  Reset<span style="color:gray;"></</span><span style="color:#569cd6;">button</span><span style="color:gray;">></span>
                <span style="color:gray;"><</span><span style="color:#569cd6;">a</span> <span style="color:#9cdcfe;">href</span><span style="color:#b4b4b4;">=</span><span style="color:#c8c8c8;">""</span><span style="color:gray;">></span>Back to Leaderboard<span style="color:gray;"></</span><span style="color:#569cd6;">a</span><span style="color:gray;">></span>
            <span style="color:gray;"></</span><span style="color:#569cd6;">div</span><span style="color:gray;">></span>
            <span style="color:gainsboro;">}</span> 
        <span style="color:gray;"></</span><span style="color:#569cd6;">a</span><span style="color:gray;">></span>
    <span style="color:gray;"></</span><span style="color:#569cd6;">div</span><span style="color:gray;">></span>
<span style="color:gainsboro;">}</span></pre>

All of this can power your website or application with rich content and assets that can be managed in [**Kentico Kontent**](http://kontent.ai/).

[![Kontent Content Inventory](https://www.mcbeev.com/getmedia/8610536f-282c-4142-86c0-0a7e01366942/Kontent-Content-Inventory_t.png.aspx?width=549&height=364 "Kontent Content Inventory - Click to enlarge")](https://www.mcbeev.com/MBV/media/uploads/2020/Kontent-Content-Inventory.png)

With this new release as of MS Build, I now need to go update to the latest version of Blazor. I wish there was more time in the day. Or if you want to make a PR to [the repo for me on my Rowling App](https://github.com/mcbeev/RowlingApp) that uses Kontent and the latest version of Blazor, go right ahead.

If you want nothing to do with my code, I won't hold it against you, you can also check out the newer [Kontent Blazor Sample app](https://github.com/petrsvihlik/Kentico.Kontent.Blazor.SampleApp) that is out. 



### The New Azure Static Web Apps

If you haven't heard about the new static file hosting option for Azure, then you weren't watching any of the MS Build hype. Azure Static Web Apps were all over the coverage of the event. They allow .Net developers to accelerate application development with a static front end and dynamic back end powered by serverless APIs. That last sentence is basically a fancy way to say Microsoft now has a way to compete against other services like Netlify as well as they have given you a nicer story around connecting static sites to Azure functions with an easy to use CI/CD pipeline. This addition is welcome and perfect for static site generators such as Hugo, Jekyll and Gatsby or for developers who use frameworks like Angular, Vue and React. 

Even though [Azure Static Web Apps](https://azure.microsoft.com/en-us/services/app-service/static/) are still technically in a preview state, they already have quite a few features. Honestly though my favorite one is the fact you can just [point to your Github repo directly from the Azure Static Web App](https://docs.microsoft.com/en-us/azure/static-web-apps/getting-started?tabs=angular) and it just works to deploy it. It's so simple. This graphic illustrates it quite well (source: Microsoft):

![Azure Static Web Apps](https://www.mcbeev.com/getmedia/29e9bb38-02e2-417b-a55d-09d65e8820c8/Azure-Static-Web-Apps.png.aspx?width=598&height=353 "Azure Static Web Apps")

If you are interested in trying **Azure Static Web Apps** there is a free [hands-on tutorial for getting started with Static Web Apps](https://docs.microsoft.com/en-us/learn/modules/publish-app-service-static-web-app-api/?WT.mc_id=build2020_swa-frameworks-cxa) over in Azure.

### Kentico Kontent and Azure Static Web Apps

While not truly .Net specific, Kontent has come a long way with its integration to Gatsby. You can use the newly update [Gatsby source plugin for Kontent](https://github.com/Kentico/kontent-gatsby-packages/tree/master/packages/gatsby-source-kontent) to create a static site with Gatsby very easily. And if you happen to be an Azure fan and know how to use it, like yours truly, you may want to deploy the new static site right to Azure instead of dealing with a new tool like Netlify. This used to be done via Azure Blob Storage's ability to host static file websites with a click of a button. But Azure Static Web Apps offer more than just the old Blob storage route.

[![Kontent Gatsby Source Plugin Readme](https://www.mcbeev.com/getmedia/0badf081-0073-4273-a25c-5b627932daf6/Kontent-Gatsby-Source-Plugin-Readme.png.aspx?width=448&height=298 "Kontent Gatsby Source Plugin Readme")](https://www.gatsbyjs.org/docs/sourcing-from-kentico-kontent/)

We have used the Gatsby source plugin at BizStream before, and it is very good. I have mentioned it in my [podcast episode on the JAMStack](https://www.mcbeev.com/Blog/February-2020/Kentico-Rocks-Podcast-Episode-29) as well. 



### .Net 5.0 Preview 4 is Here

.Net 5 is critical to know about if you are a .Net developer. It is the future of where the .Net full framework, .Net Standard, and .Net Core are going. The frameworks will be unified into .Net 5.0. [ASP.NET Core](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-4/), and [EF Core](https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-5-0-preview-4/) are also being released. [PowerShell has a .NET 5-based release](https://devblogs.microsoft.com/powershell/powershell-team-may-2020-update/) as well. .Net 5.0 also includes C# 9.0, performance increases left and right through the whole stack, and a very cool [new System.Text.JSON](https://docs.microsoft.com/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to) JSON api for .Net developers to name a few highlights. 

I should also mention that a new build of EF is out, [Entity Framework Core 5.0 Preview 4](https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-5-0-preview-4/). EF Core 5.0 has a whole set of new features, and it's best to read about them on the [What's new in the EF blog post series](https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-5.0/whatsnew). 

### Kentico Kontent and .Net 5.0

I have blogged about [.Net 5.0 and Kentico EMS](https://www.mcbeev.com/Blog/March-2020/Net-5-with-Kentico-13-Beta-2) previously. Thinking about it from the Kontent side of the world is actually pretty similar. If you are building .Net apps that integrate with Kontent today, you are most likely using .Net Core 3.1\. If you are not at least using .Net Core shame on you! If you are doing anything new at all, I would highly recommend starting with .Net 5.0 as you framework as .Net 5.0 is promised to be out and production ready by November of this year. 

If you want to try out .Net 5.0 and Kontent you can start with [Building your first .Net app documentation](https://docs.kontent.ai/tutorials/develop-apps/get-started/build-your-first-app?tech=dotnet) that Kontent has. This updated documentation makes it fairly easy to get going. You will learn how to use the [.Net Core CLI](https://www.mcbeev.com/Blog/May-2019/Kentico-Rocks-Podcast-Episode-20) with to create a new boilerplate project that is all tied up to Kontent. 

The [Kontent Boilerplate for .Net](https://github.com/Kentico/kontent-boilerplate-net) has been recently updated by [Petr Svihlik](https://github.com/petrsvihlik) and the Kontent team. The boilerplate lets you scaffold a web project for use with Kentico Kontent and gives you a head start when compared to starting from a blank project. It includes a set of pre-configured features and demonstrates best practices for how to use Kontent and .Net MVC.

After you run through the sample installation to get started with .Net Core 3.1, you can simply perform the following steps on your .csproj file:

![Project File Changes for .Net 5.0](https://www.mcbeev.com/MBV/media/uploads/2020/Project-File-Changes-for-Net-5.png "Project File Changes for .Net 5.0")

![Project File Changes for .Net 5.0 2](https://www.mcbeev.com/MBV/media/uploads/2020/Project-File-Changes-for-Net-5-2.png "Project File Changes for .Net 5.0 2")

Save those changes, and then go update the NuGet package references and you should be set. Full disclosure though I have not tested the process 100%. **Make sure you have the [.Net 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) installed before you start this**.

Another option would be to check out the newer project, [ASP.NET Core extensions for Kentico Kontent apps](https://github.com/Kentico/kontent-aspnetcore). This project is the start of adding in a set of specific features to any .Net app that uses Kontent in .Net Core / .Net 5.0 whether that app was started with the boilerplate or not. Right now it contains a taghelper for working with [Responsive images in Kontent](https://www.mcbeev.com/Blog/July-2018/Leveling-Up-A-Kentico-Cloud-Project-Part-2), and the ability to subscribe to Webhooks from Kontent. This project is distributed as a straight up [NuGet Package for Kontent](https://www.nuget.org/packages/Kentico.Kontent.AspNetCore/) and .Net Core.

**Existing Kontent Delivery SDK Users Need to Know**

The Kontent team has also been putting in a lot of work on updating and improving the C# aspect of the Delivery SDK for .Net as well. The best way  to summerize the new changes that .Net developers need to know is to refer to the new [**Best practices for Delivery SDK for .NET**](https://github.com/Kentico/kontent-delivery-sdk-net/wiki) wiki page on the Github repo. In there you will find out what is new and recommended. Here are three examples that really stick out.

Now you can register the DeliveryClient in a new way using an **IHttpDeliveryClientFactory** object**.** This object can be used to serve as a named IDeliveryClient, which means now you can have more DeliveryClients with different sets of options which is the new best practice. Check out [Registering the DeliveryClient to the IServiceCollection](https://github.com/Kentico/kontent-delivery-sdk-net/wiki/Registering-the-DeliveryClient-to-the-IServiceCollection-in-ASP.NET-Core) wiki page for the full details.

> **Original way**: 
> 
> _services.AddHttpClient<KontentDeliveryService>(); // only one of these ever_

> **New way:**
> 
> _services.AddDeliveryClient("production", Configuration, "DeliveryOptions1");  
> services.AddDeliveryClient("preview", Configuration, "DeliveryOptions2"); // notice different options for preview _  
> // Could also use the DeliveryOptionsBuilder options too, see the docs

The second enhancement that sticks out is the ability to **now use the HttpClient retry policy** that comes in .Net Standard because the [Delivery SDK has added support for the HttpClientFactory pipeline](https://github.com/Kentico/kontent-delivery-sdk-net/wiki/Registering-the-DeliveryClient-to-the-IServiceCollection-in-ASP.NET-Core#httpclientfactory), where you can use the HttpClient instance from this factory. Using the **HttpClientFactory** increases the [stability and performance](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests) of your application. It also allows you to set up other features on top of it, such as [Polly for Retry Logic](https://docs.microsoft.com/en-US/dotnet/architecture/microservices/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly).

> **Inside of ConfigureServices()**
> 
> _services.AddHttpClient<IDeliveryHttpClient, DeliveryHttpClient>();_

Lastly, there is a new service regitration method for registering a custom caching package with the DeliveryClient, the **AddDeliveryClientCache()** method. The new **DeliveryCacheOptions** class allows you to create different caching options per registered DeliveryClient (think the first example above) or even to roll you own. 

When you combine these three examples, you have a great solution for handling live production content in one way, preview content in another way, or even secure content in a third way. This new set of C# code in the .Net SDK for the Delivery API really is a welcome improvement for large projects. Or projects that use the **[new Environments](https://docs.kontent.ai/tutorials/set-up-kontent/projects/manage-environments) feature of Kontent**. 

> **Pro Tip:** If you are an existing consumer of the .Net Delivery SDK you might want to go make a new branch and update your [**Kentico.Kontent.Delivery NuGet package**](https://www.nuget.org/packages/Kentico.Kontent.Delivery/) to try out some of these new features.



### Microsoft Bot Framework 4.9 Released

You can't mention cool .Net technology without talking about the Microsoft Bot Framework. At this year's Build virtual event, version 4.9 was released to Bot builders and developers out there. There are many new features with the [4.9 release](https://github.com/microsoft/botbuilder-dotnet/releases/tag/4.9.0). They include:

*   Skills and Bot Framework Composer support for building and consuming Skills
*   Improved Microsoft Teams api integration
*   Authentication improvements
*   Bot Telemetry
*   Language generation
*   Adaptive Dialogs
*   Generated Dialogs
*   Health Checks for the Bots
*   and more that make creating Bots easy

### Kentico Kontent and the Microsoft Build Framework

One thing that .Net developers and businesses struggle with currently is making Bots that are intelligent, know how to handle interrupts in the conversation, and are in more than just the English culture. I feel that is a scenario that makes sense for integrating a Bot with Kontent. Kontent is great at providing content in multiple languages / cultures. Sometimes the text of a conversation is hard coded, or placed in resource strings, or some other developer type of solution. Using Kontent to manage the text of a conversation and utilizing [Language Variants of Content Items](https://docs.kontent.ai/tutorials/write-and-collaborate/create-multilingual-content/translate-content-items) in Kontent is a much better choice.  

Hint, hint Kontent developer relations team, maybe having a Bot Framework starter app makes sense. Maybe I could convert my [Kentico E-commerce Bot](https://www.mcbeev.com/Blog/February-2017/Building-a-Kentico-E-Commerce-Chat-Bot) over to Kontent as well.



### .NET Multi-platform App UI (MAUI)

[.NET MAUI](https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/) is the new .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. It has barely seen the light of day and is in preview mode as well. 

![.Net MAUI](https://www.mcbeev.com/MBV/media/uploads/2020/Net-MAUI.png ".Net MAUI")

But the promise for MAUI is an evolution of the increasingly popular Xamarin.Forms toolkit. MAUI extends the success of Xamarin on mobile to embrace the desktop making it the best way to build multi-platform applications across both mobile and desktop. It is going to be interesting to keep an eye on this one.

I would really recommend watching the video on this blog post about .Net MAUI to help think through the [migration of Xamarin to MAUI](https://devblogs.microsoft.com/xamarin/microsoft-build-2020-xamarin/).

### Kentico Kontent and .Net MAUI

This is one area where I don't have specific experience with the toolset as mobile development doesn't really interest me. Kontent does have a somewhat old Xamarin story at the [archived sample app](https://github.com/Kentico/cloud-sample-app-xamarin). If you are looking to do something in the native mobile space it might be worth looking at slightly. Overall if I had to high level the approach of getting Kontent working with MAUI it would be one step. Just wait. It's not ready yet.



### Useful Links and Other Notable New .Net Kontent Items

These items do not correlate specifically with Build, but none the less, we can't talk about .Net news without mentioning some other improvements that have me excited about working with Kontent. These items have also all been recently updated by the Kontent team.

*   [Kentico Kontent Docs: Develop .Net Apps with Kontent](https://docs.kontent.ai/tutorials/develop-apps?tech=dotnet)
*   [Kentico Kontent sample ASP.NET Core Razor Pages web app](https://github.com/Kentico/kontent-sample-app-razorpages)
*   [Kentico Kontent .Net SDKs for Delivery, Management, and Recommendations](https://docs.kontent.ai/tutorials/develop-apps/get-started/sdks)
*   [Kentico Kontent .Net Delivery SDK Best Practices](https://github.com/Kentico/kontent-delivery-sdk-net/wiki) - **(again highly recommended)**
*   [Kentico Kontent .Net Core 3.1 Clean Architecture - part 1](https://www.bizstream.com/blog/march-2020/net-core-kentico-kontent-clean-architecture), [part 2](https://www.bizstream.com/blog/march-2020/kentico-kontent-clean-architecture-implementation), [part 3](https://www.bizstream.com/blog/february-2020/route-link-content-net-core-mvc-kentico-kontent), and [part 4](https://www.bizstream.com/blog/march-2020/net-core-kentico-kontent-part-4-linked-items)



### A Lot is Going On in the .Net, Azure, and Kontent World

At Microsoft Build 2020 there were many updates around Microsoft .Net, Azure, new development tools and techniques and their capabilities. So many, in fact, that listing more of them here would be very tedious. I tried my best to list the most interesting announcements from a C# .Net developer point of view. If you are still looking for more, the best place I found for a single source of all of the information around Build as the official [Build 2020 Book of News](https://news.microsoft.com/build-2020-book-of-news/) over at Microsoft.com. 

I hope I have also given a good summary update of how Kontent continues to support .Net development in 2020 through its updated Delivery SDKs, Kontent Boilerplate, and various Nuget Packages and Github Repositories targeted at developers.

I'm also curious on how the Kentico community is working with Kontent in .Net Core, Blazor, or on Azure. If you have a good story or good project that uses this technology, please reach out to me. I'd love to host you on my next [**Kentico Rocks Podcast**](https://www.mcbeev.com/kenticorocks). Thanks and happy .Netting!