<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on CodingBlast</title><link>https://codingblast.com/posts/</link><description>Recent content in Posts on CodingBlast</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 27 Dec 2022 01:58:41 +0000</lastBuildDate><atom:link href="https://codingblast.com/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>How to set up perfect command-line environment on Windows</title><link>https://codingblast.com/how-to-set-up-perfect-command-line-environment-on-windows/</link><pubDate>Sun, 28 Mar 2021 16:06:48 +0000</pubDate><guid>https://codingblast.com/how-to-set-up-perfect-command-line-environment-on-windows/</guid><description>&lt;h2 id="windows-terminal"&gt;Windows Terminal&lt;/h2&gt;
&lt;p&gt;First of all, you should install Windows Terminal. It is a modern terminal emulator for users of command-tools and shells, including PowerShell, bash within WSL, SSH, Command Prompt, and any other command-line app.&lt;/p&gt;</description></item><item><title>Why is ASP.NET Core good for Enterprise applications</title><link>https://codingblast.com/asp-net-core-for-enterprise/</link><pubDate>Sat, 13 Mar 2021 17:40:33 +0000</pubDate><guid>https://codingblast.com/asp-net-core-for-enterprise/</guid><description>&lt;h2 id="speed"&gt;Speed&lt;/h2&gt;
&lt;p&gt;ASP.NET Core is by far the fastest full-stack major web framework out there. Full-stack, meaning a framework that provides wide feature coverage, including server-side templates, database connectivity, form processing, and so on. Major means it&amp;rsquo;s widely adopted, used by the community, and supported by a big company and/or community.&lt;/p&gt;</description></item><item><title>ASP.NET Core Dependency Injection - Cannot consume scoped service</title><link>https://codingblast.com/asp-net-core-dependency-injection-cannot-consume-scoped-service/</link><pubDate>Sat, 18 Jan 2020 12:23:12 +0000</pubDate><guid>https://codingblast.com/asp-net-core-dependency-injection-cannot-consume-scoped-service/</guid><description>&lt;p&gt;When working with ASP.NET Core and it&amp;rsquo;s Dependency Injection container, you will likely run into an error that&amp;rsquo;s similar to this one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Some services are not able to be constructed (Error while validating the service descriptor &amp;lsquo;ServiceType: AspNetCoreDi.IMyConnectionManager Lifetime: Singleton ImplementationType: AspNetCoreDi.MyConnectionManager&amp;rsquo;: Cannot consume scoped service &amp;lsquo;AspNetCoreDi.IMyScopedService&amp;rsquo; from singleton &amp;lsquo;AspNetCoreDi.IMyConnectionManager&amp;rsquo;.)&lt;/p&gt;</description></item><item><title>Hosting ASP.NET Core on Heroku (with Docker&amp;CircleCI) for free</title><link>https://codingblast.com/hosting-asp-net-core-on-heroku-with-dockercircleci-for-free/</link><pubDate>Fri, 08 Feb 2019 07:31:03 +0000</pubDate><guid>https://codingblast.com/hosting-asp-net-core-on-heroku-with-dockercircleci-for-free/</guid><description>&lt;h2 id="the-problem"&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;You have an application that you need to show off to your friends or a client, and they all need to access it online, and you don&amp;rsquo;t want to use your old server in your basement. If it&amp;rsquo;s a &lt;em&gt;small&lt;/em&gt; application, you can easily do all this for FREE!&lt;/p&gt;</description></item><item><title>More C# 7 goodness - Span of T - Span&lt;T&gt;</title><link>https://codingblast.com/span-of-t/</link><pubDate>Wed, 23 May 2018 10:16:12 +0000</pubDate><guid>https://codingblast.com/span-of-t/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;With C# 7.2 we got a new type: &lt;strong&gt;Span&lt;T&gt;&lt;/strong&gt;. So, what is &lt;em&gt;Span&lt;/em&gt;? &lt;em&gt;&lt;strong&gt;Span&lt;/strong&gt;&lt;/em&gt; is a new value type that enables us to work and manage any type that represents a contiguous chunk of memory.&lt;/p&gt;</description></item><item><title>ASP.NET Core Authorization - Using attributes for handlers and requirements</title><link>https://codingblast.com/asp-net-core-authorization-resources/</link><pubDate>Thu, 26 Apr 2018 22:08:47 +0000</pubDate><guid>https://codingblast.com/asp-net-core-authorization-resources/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Dealing with authentication and authorization in ASP.NET Core while working with modern web apps has been a much better experience than in older versions of ASP.NET. And it&amp;rsquo;s been further improved with v2. There are few quirks when you work with it enough, but the overall feeling is much better.&lt;/p&gt;</description></item><item><title>JavaScript Collections - Set and Map</title><link>https://codingblast.com/javascript-set-map/</link><pubDate>Tue, 27 Feb 2018 07:14:18 +0000</pubDate><guid>https://codingblast.com/javascript-set-map/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this post we will get familiar with two different collections in JavaScript:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Set&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Map&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In one of the next posts we will also talk about two similar collections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;WeakSet&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;WeakMap&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;They were all introduced to JavaScript spec with ES2015, also known as ES6.&lt;/p&gt;</description></item><item><title>ASP.NET Core 2 - Global Model validation</title><link>https://codingblast.com/asp-net-core-global-model-validation/</link><pubDate>Sat, 24 Feb 2018 11:34:56 +0000</pubDate><guid>https://codingblast.com/asp-net-core-global-model-validation/</guid><description>&lt;h2 id="how-we-some-of-us-do-model-validation-right-now"&gt;How we (some of us?) do Model validation right now&lt;/h2&gt;
&lt;p&gt;We, developers, use a lot of repetitive code in our ASP.NET (Core) Web API / MVC actions. Inside of our controller actions we usually check if the model is valid by using &lt;em&gt;ModelState&lt;/em&gt;property available on MVC&amp;rsquo;s base controller class:&lt;/p&gt;</description></item><item><title>ASP.NET Core - Unit testing IAuthorizationService and dependencies inside of your controller</title><link>https://codingblast.com/asp-net-core-unit-testing-authorizationservice-inside-controller/</link><pubDate>Mon, 12 Feb 2018 16:52:08 +0000</pubDate><guid>https://codingblast.com/asp-net-core-unit-testing-authorizationservice-inside-controller/</guid><description>&lt;h2 id="unit-testing---iauthorizationservice-requirement-and-handler"&gt;Unit Testing - IAuthorizationService, Requirement and Handler&lt;/h2&gt;
&lt;p&gt;You have a controller that makes use of &lt;em&gt;IAuthorizationService&lt;/em&gt; and you have a custom requirement - implementation of &lt;em&gt;IAuthorizationRequirement&lt;/em&gt;. You might also have your custom handler which is an implementation of &lt;em&gt;IAuthorizationHandler&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>ASP.NET Core - InvalidOperationException: Cannot find compilation library location for package 'Microsoft.Win32.Registry'</title><link>https://codingblast.com/asp-net-core-invalidoperationexception-cannot-find-compilation-library-location-package-microsoft-win32-registry/</link><pubDate>Thu, 01 Feb 2018 10:55:22 +0000</pubDate><guid>https://codingblast.com/asp-net-core-invalidoperationexception-cannot-find-compilation-library-location-package-microsoft-win32-registry/</guid><description>&lt;h2 id="tldr"&gt;TL;DR&lt;/h2&gt;
&lt;p&gt;Add following line to your &lt;strong&gt;.csproj&lt;/strong&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;MvcRazorExcludeRefAssembliesFromPublish&gt;false&lt;/MvcRazorExcludeRefAssembliesFromPublish&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I was publishing a project I am working on to web server (Linux) and I had an issue with Razor Pages.&lt;/p&gt;
&lt;p&gt;However, it seems that this error occurs only when you precompile your Razor views (MVC views, Razor Pages). Why would you do that? Well, precompiling your views results in a smaller published bundle and faster startup time.&lt;/p&gt;</description></item><item><title>Using React Router v4 with create-react-app</title><link>https://codingblast.com/react-router-create-react-app/</link><pubDate>Mon, 15 Jan 2018 07:11:06 +0000</pubDate><guid>https://codingblast.com/react-router-create-react-app/</guid><description>&lt;h2 id="introduction---react-router"&gt;Introduction - react-router&lt;/h2&gt;
&lt;p&gt;React-router is the most popular routing solution for applications made in React. It is a collection of &lt;strong&gt;navigational components&lt;/strong&gt; that compose declaratively with your application. Bookmarkable URLs, history, customizable navigation links and quite a few other features come with it.&lt;/p&gt;</description></item><item><title>C# 7.1 - New features</title><link>https://codingblast.com/csharp-7-1-new-features/</link><pubDate>Sat, 06 Jan 2018 11:28:26 +0000</pubDate><guid>https://codingblast.com/csharp-7-1-new-features/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In some of the previous posts we talked about new features in &lt;a href="https://codingblast.com/c-7-new-features/"&gt;C# 7&lt;/a&gt; and we talked about the &lt;a href="https://codingblast.com/nameof-expression/"&gt;usage of &lt;em&gt;nameof&lt;/em&gt; expression&lt;/a&gt; in C#. In this post, we will talk about new features that came with C# 7.1.&lt;/p&gt;</description></item><item><title>ASP.NET Core Interview Questions</title><link>https://codingblast.com/asp-net-core-interview-questions/</link><pubDate>Wed, 03 Jan 2018 16:41:45 +0000</pubDate><guid>https://codingblast.com/asp-net-core-interview-questions/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;ASP.NET Core and .NET Core have been in development for years already. If you look into ASP.NET Core MVC repository history, you will find commits from July 2013. These are the new frameworks from Microsoft, that are the completely open source and cross-platform.&lt;/p&gt;</description></item><item><title>C# 7 - reference returns &amp; local references</title><link>https://codingblast.com/csharp-7-return-reference-local-reference/</link><pubDate>Sat, 30 Dec 2017 14:32:41 +0000</pubDate><guid>https://codingblast.com/csharp-7-return-reference-local-reference/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In on of the &lt;a href="https://codingblast.com/c-7-new-features/"&gt;last posts&lt;/a&gt;, we talked about some of the big features that came with C# 7. In this post, we will continue on that and we will talk about returning references from functions and storing references inside of local variables.&lt;/p&gt;</description></item><item><title>JavaScript Promises, road to async/await</title><link>https://codingblast.com/javascript-promise-async-await/</link><pubDate>Sun, 24 Dec 2017 15:38:14 +0000</pubDate><guid>https://codingblast.com/javascript-promise-async-await/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Asynchronous and synchronous are kinda complex concepts for beginners. Even some experienced developers fail to comprehend the differences.&lt;/p&gt;
&lt;p&gt;The synchronous code is something that executes sequentially and everything else waits until that piece of code executes. When you do something asynchronously in JavaScript, you are scheduling it to execute &lt;em&gt;later&lt;/em&gt;. And &lt;em&gt;later&lt;/em&gt; is some time in future after all synchronous code completes. Actually, that is only the earliest possible time that it can execute. It can happen even later if there is another async code that is &lt;em&gt;scheduled&lt;/em&gt; to execute.&lt;/p&gt;</description></item><item><title>Organising JavaScript helpers</title><link>https://codingblast.com/organising-javascript-helpers/</link><pubDate>Sat, 09 Dec 2017 09:24:39 +0000</pubDate><guid>https://codingblast.com/organising-javascript-helpers/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Since 2015 ECMAScript switched to yearly releases and they also switched to new naming format: ES_{Year}.&lt;/p&gt;
&lt;p&gt;With the arrival of ES6 or to be correct, ES 2015 we got support for classes in JavaScript. Also, we got new keywords: &lt;em&gt;import&lt;/em&gt; and &lt;em&gt;export&lt;/em&gt;. And this can make the code much cleaner and easier to work with.&lt;/p&gt;</description></item><item><title>ASP.NET Core SignalR Chat with React.js</title><link>https://codingblast.com/asp-net-core-signalr-chat-react/</link><pubDate>Fri, 17 Nov 2017 23:39:39 +0000</pubDate><guid>https://codingblast.com/asp-net-core-signalr-chat-react/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In one of the last posts, we saw how we can make a simple chat with &lt;a href="https://codingblast.com/asp-net-core-signalr-chat-angular/"&gt;ASP.NET Core SignalR and Angular 5&lt;/a&gt;. This time, we will use the same code from the backend and swap Angular with React on the frontend.&lt;/p&gt;</description></item><item><title>ASP.NET Core SignalR Chat with Angular 5</title><link>https://codingblast.com/asp-net-core-signalr-chat-angular/</link><pubDate>Tue, 14 Nov 2017 08:19:52 +0000</pubDate><guid>https://codingblast.com/asp-net-core-signalr-chat-angular/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In one of the &lt;a href="https://codingblast.com/asp-net-core-signalr-simple-chat/"&gt;previous&lt;/a&gt; posts, we saw how we can make a simple chat with ASP.NET Core SignalR. It takes about 5-10 mins for someone who is familiar with the environment and ASP.NET Core. Or even less.&lt;/p&gt;</description></item><item><title>C# 7 - new features</title><link>https://codingblast.com/c-7-new-features/</link><pubDate>Sat, 04 Nov 2017 08:52:54 +0000</pubDate><guid>https://codingblast.com/c-7-new-features/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;C# is a powerful object-oriented language that is very easy to pick-up. The syntax is so simple but there are so many powerful and great features in C#. Some of the amazing features are lambdas, LINQ, generics, interfaces, async/await. They are all powerful concepts and it is a delight to use them with C#. With .NET Core being open source and cross-platform and ability to build for so many platforms and devices it is good to know ins and outs of the language.&lt;/p&gt;</description></item><item><title>Using Web API only on ASP.NET Core - Without MVC specific stuff</title><link>https://codingblast.com/using-web-api-asp-net-core-without-mvc-specific-stuff/</link><pubDate>Thu, 12 Oct 2017 05:22:05 +0000</pubDate><guid>https://codingblast.com/using-web-api-asp-net-core-without-mvc-specific-stuff/</guid><description>&lt;h2 id="web-api-vs-mvc"&gt;Web API vs MVC&lt;/h2&gt;
&lt;p&gt;MVC and Web API have many things in common. Things like filters, attributes, controllers. Since MVC and Web API share so many things with ASP.NET Core we got these two unified into one framework.&lt;/p&gt;</description></item><item><title>Why you should learn ASP.NET Core</title><link>https://codingblast.com/why-asp-net-core/</link><pubDate>Sun, 08 Oct 2017 23:16:42 +0000</pubDate><guid>https://codingblast.com/why-asp-net-core/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;h3 id="a-bit-of-history"&gt;A bit of History&lt;/h3&gt;
&lt;p&gt;I have been surprised by the fact that so many people are not aware of Microsoft&amp;rsquo;s open source shift over last 5 (and maybe few more) years. Lots of people are not aware of current state of .NET, .NET Core and ASP.NET Core. And I do not blame them, they have been occupied by some other responsibilities or technologies.&lt;/p&gt;</description></item><item><title>EntityFramework Core - Add an implementation of IDesignTimeDbContextFactory - Multiple DbContext's</title><link>https://codingblast.com/entityframework-core-add-implementation-idesigntimedbcontextfactory-multiple-dbcontexts/</link><pubDate>Thu, 21 Sep 2017 19:47:57 +0000</pubDate><guid>https://codingblast.com/entityframework-core-add-implementation-idesigntimedbcontextfactory-multiple-dbcontexts/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;We already talked about problem when Entity Framework Core tooling requires you to implement &lt;em&gt;IDesignTimeDbContextFactory&lt;DbContext&gt;&lt;/em&gt; - check out &lt;a href="https://codingblast.com/entityframework-core-idesigntimedbcontextfactory/"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It gets interesting when you have more than one &lt;em&gt;DbContext&lt;/em&gt; in your application and you want to add another implementation of &lt;em&gt;IDesignTimeDbContextFactory&lt;/em&gt;, without repeating the code and making sure that EF Core tooling picks the right one.&lt;/p&gt;</description></item><item><title>Entity Framework Core Generic Repository</title><link>https://codingblast.com/entity-framework-core-generic-repository/</link><pubDate>Wed, 20 Sep 2017 18:53:19 +0000</pubDate><guid>https://codingblast.com/entity-framework-core-generic-repository/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Entity Framework Core Generic Repository - Behold! The topic that some people will frown upon. They don&amp;rsquo;t even wanna talk about it. However, others love it, they feel all excited on the mention of generic repository pattern.&lt;/p&gt;</description></item><item><title>ASP.NET Core Configuration - Reloading, Binding, Injecting</title><link>https://codingblast.com/asp-net-core-configuration-reloading-binding-injecting/</link><pubDate>Thu, 14 Sep 2017 08:10:55 +0000</pubDate><guid>https://codingblast.com/asp-net-core-configuration-reloading-binding-injecting/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/asp-net-core-configuration/"&gt;last post&lt;/a&gt;, we talked about ASP.NET Core Configuration in general.&lt;/p&gt;
&lt;p&gt;We saw how is it set up by default from ASP.NET Core.&lt;/p&gt;
&lt;p&gt;We also talked about sources and that order matters.&lt;/p&gt;
&lt;p&gt;This time we will talk about mapping configuration to classes.&lt;/p&gt;</description></item><item><title>ASP.NET Core Configuration</title><link>https://codingblast.com/asp-net-core-configuration/</link><pubDate>Sun, 10 Sep 2017 11:02:32 +0000</pubDate><guid>https://codingblast.com/asp-net-core-configuration/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;ASP.NET Core configuration differs greatly from standard ASP.NET.
Instead of web.config or any other way to set up the configuration we use built-in Configuration framework that comes with ASP.NET Core.
It is still key-value pairs collection at the end, but we can obtain those values from various sources. One of default sources is &lt;strong&gt;appsettings.json&lt;/strong&gt; file that comes with all templates. ASP.NET Core 2 templates have configuration already filled with values from &lt;strong&gt;appsettings.json&lt;/strong&gt; file, along with few other sources.
However, we can use and &lt;strong&gt;combine&lt;/strong&gt; various sources for configuration settings (values):&lt;/p&gt;</description></item><item><title>nameof expression is amazing! Say NO to magic strings!</title><link>https://codingblast.com/nameof-expression/</link><pubDate>Sun, 03 Sep 2017 18:09:36 +0000</pubDate><guid>https://codingblast.com/nameof-expression/</guid><description>&lt;h2 id="the-nameof-expression"&gt;The nameof expression&lt;/h2&gt;
&lt;p&gt;This is one of many goodies that came with C# 6.0. That was back in July 2015.&lt;/p&gt;
&lt;p&gt;I have been using &lt;em&gt;nameof&lt;/em&gt;for quite a while now, but at the start, I wasn&amp;rsquo;t really aware of its full potential! Oh, what a sinner!&lt;/p&gt;</description></item><item><title>Google Analytics Tag Helper Component</title><link>https://codingblast.com/tag-helper-component-google-analytics/</link><pubDate>Fri, 01 Sep 2017 22:23:17 +0000</pubDate><guid>https://codingblast.com/tag-helper-component-google-analytics/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/tag-helper-components/"&gt;last pos&lt;/a&gt;t, we talked about &lt;a href="https://codingblast.com/tag-helper-components/"&gt;Tag Helper Components&lt;/a&gt; and how we can use them to modify existing HTML elements and inject scripts on the fly.&lt;/p&gt;
&lt;p&gt;I needed Google Analytics scripts in my ASP.NET Core application, so I decided to make a NuGet package for that.&lt;/p&gt;</description></item><item><title>ASP.NET Core MVC - Tag Helper Components</title><link>https://codingblast.com/tag-helper-components/</link><pubDate>Fri, 25 Aug 2017 10:45:27 +0000</pubDate><guid>https://codingblast.com/tag-helper-components/</guid><description>&lt;h2 id="tag-helper-components---introduction"&gt;Tag Helper Components - Introduction&lt;/h2&gt;
&lt;p&gt;We already talked about &lt;a href="https://codingblast.com/asp-net-core-tag-helpers/"&gt;Tag Helpers&lt;/a&gt; in several posts before. This time we will be talking about something related.&lt;/p&gt;
&lt;p&gt;ASP.NET Core 2 is here and it brings us a new feature - &lt;strong&gt;Tag Helper Components&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>EntityFramework Core - Add an implementation of IDesignTimeDbContextFactory</title><link>https://codingblast.com/entityframework-core-idesigntimedbcontextfactory/</link><pubDate>Mon, 21 Aug 2017 15:09:44 +0000</pubDate><guid>https://codingblast.com/entityframework-core-idesigntimedbcontextfactory/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Your DbContext in a separate project - class library project. You are trying to add new migration and update database, and you are running into this error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unable to create an object of type &amp;lsquo;CodingBlastDbContext&amp;rsquo;. Add an implementation of &amp;lsquo;IDesignTimeDbContextFactory&amp;rsquo; to the project, or see &lt;a href="https://go.microsoft.com/fwlink/?linkid=851728"&gt;https://go.microsoft.com/fwlink/?linkid=851728&lt;/a&gt; for additional patterns supported at design time.&lt;/p&gt;</description></item><item><title>ASP.NET Core - Best practices (tips and tricks) - an opinionated approach - Part 2</title><link>https://codingblast.com/asp-net-core-best-practices-2/</link><pubDate>Sun, 20 Aug 2017 15:25:19 +0000</pubDate><guid>https://codingblast.com/asp-net-core-best-practices-2/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/asp-net-core-best-practices/"&gt;last post&lt;/a&gt;, we talked about tips and tricks, different strategies and approaches to make your code and project easier to maintain.&lt;/p&gt;
&lt;p&gt;This post is the second part in the series.&lt;/p&gt;
&lt;h3 id="avoid-html-helpers---use-tag-helpers"&gt;Avoid HTML Helpers - Use Tag Helpers&lt;/h3&gt;
&lt;p&gt;We should avoid using HTML Helpers in favour of Tag Helpers.&lt;/p&gt;</description></item><item><title>ASP.NET Core - Best practices (tips and tricks) - an opinionated approach - Part 1</title><link>https://codingblast.com/asp-net-core-best-practices/</link><pubDate>Fri, 18 Aug 2017 07:10:43 +0000</pubDate><guid>https://codingblast.com/asp-net-core-best-practices/</guid><description>&lt;h2 id="introduction---aspnet-core-best-practices"&gt;Introduction - ASP.NET Core Best Practices&lt;/h2&gt;
&lt;p&gt;This post is about ASP.NET Core best practices post. We will talk about some of the best practices while working with ASP.NET Core. It is a collection of tips and tricks, different strategies and approaches to make your code and project easier to maintain. Also, it will be more pleasant to work on the project. These include the ways to organise the solution, project, pieces of code, tips for writing tests and other things that developers deal with.&lt;/p&gt;</description></item><item><title>ASP.NET Core - ConfigureServices vs Configure</title><link>https://codingblast.com/asp-net-core-configureservices-vs-configure/</link><pubDate>Sun, 13 Aug 2017 21:20:45 +0000</pubDate><guid>https://codingblast.com/asp-net-core-configureservices-vs-configure/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;We already talked about Configuration method inside of Startup when we talked about &lt;a href="https://codingblast.com/asp-net-core-middleware/"&gt;requests and middleware&lt;/a&gt;. In this post, we will see what exactly &lt;em&gt;ConfigureServices&lt;/em&gt; and &lt;em&gt;Configure&lt;/em&gt; methods are for and how they differ.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://codingblast.com/asp-net-core-2-preview/"&gt;ASP.NET Core&lt;/a&gt; we have a &lt;strong&gt;Startup&lt;/strong&gt; class where &lt;a href="https://codingblast.com/asp-net-core-middleware/"&gt;all the configuration&lt;/a&gt; is done and processed once the application is starting.&lt;/p&gt;</description></item><item><title>ASP.NET Core SignalR - Simple chat</title><link>https://codingblast.com/asp-net-core-signalr-simple-chat/</link><pubDate>Mon, 07 Aug 2017 06:03:05 +0000</pubDate><guid>https://codingblast.com/asp-net-core-signalr-simple-chat/</guid><description>&lt;h2 id="update"&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;The code has been updated to use latest SignalR - 6 which works with ASP.NET Core 6&lt;/p&gt;
&lt;p&gt;Link to GitHub repository: &lt;a href="https://github.com/Ibro/SignalRSimpleChat"&gt;https://github.com/Ibro/SignalRSimpleChat&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Angular 5 version: &lt;a href="https://codingblast.com/asp-net-core-signalr-chat-angular/"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React.js version:&lt;/strong&gt; &lt;a href="https://codingblast.com/asp-net-core-signalr-chat-react/"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/asp-net-core-signalr/"&gt;last post&lt;/a&gt;, we briefly mentioned what SignalR is all about and talked about the history of the SignalR.&lt;/p&gt;</description></item><item><title>ASP.NET Core SignalR Introduction</title><link>https://codingblast.com/asp-net-core-signalr/</link><pubDate>Fri, 04 Aug 2017 18:21:19 +0000</pubDate><guid>https://codingblast.com/asp-net-core-signalr/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications. Real-time web functionality is the ability to have server code push content to connected clients instantly as it becomes available, and not having the server wait for a client to ask for new data.&lt;/p&gt;</description></item><item><title>ASP.NET Core MVC - Custom Tag Helpers</title><link>https://codingblast.com/asp-net-core-mvc-custom-tag-helpers/</link><pubDate>Mon, 31 Jul 2017 07:06:17 +0000</pubDate><guid>https://codingblast.com/asp-net-core-mvc-custom-tag-helpers/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In on of the previous posts we talked about &lt;a href="https://codingblast.com/asp-net-core-tag-helpers/"&gt;Tag Helpers&lt;/a&gt;, we also talked about &lt;a href="https://codingblast.com/asp-net-core-mvc-caching-taghelpers/"&gt;caching Tag Helpers&lt;/a&gt; and &lt;a href="https://codingblast.com/asp-net-core-mvc-form-tag-helpers/"&gt;form Tag Helpers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By creating our custom Tag Helpers, we have an ability to extend existing HTML elements or create our custom HTML elements.&lt;/p&gt;</description></item><item><title>ASP.NET Core Razor Pages - Handler Methods</title><link>https://codingblast.com/asp-net-core-razor-pages-handlers/</link><pubDate>Sat, 29 Jul 2017 07:44:43 +0000</pubDate><guid>https://codingblast.com/asp-net-core-razor-pages-handlers/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/asp-net-core-razor-pages/"&gt;last post&lt;/a&gt;, we talked about &lt;a href="https://codingblast.com/asp-net-core-razor-pages/"&gt;Razor Pages&lt;/a&gt;. Today we will talk more about handlers.&lt;/p&gt;
&lt;p&gt;We saw that we could have our code and model either in a &lt;em&gt;.cshtml&lt;/em&gt; file or inside of &lt;em&gt;code behind&lt;/em&gt;file that matches the &lt;em&gt;.cshtml&lt;/em&gt; - &lt;em&gt;&lt;strong&gt;.cshtml.cs&lt;/strong&gt;&lt;/em&gt; file.&lt;/p&gt;</description></item><item><title>ASP.NET Core Razor Pages – Introduction</title><link>https://codingblast.com/asp-net-core-razor-pages/</link><pubDate>Sun, 23 Jul 2017 13:25:25 +0000</pubDate><guid>https://codingblast.com/asp-net-core-razor-pages/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;With ASP.NET Core 2 around the corner, the hottest new thing that we are getting is Razor Pages. In one of the &lt;a href="https://codingblast.com/asp-net-core-2-preview/"&gt;previous posts&lt;/a&gt;, we briefly mentioned ASP.NET Core Razor Pages.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Razor Pages is a new feature of ASP.NET Core that makes coding page-focused scenarios easier and more productive.&lt;/p&gt;</description></item><item><title>ASP.NET Core MVC - Form Tag Helpers</title><link>https://codingblast.com/asp-net-core-mvc-form-tag-helpers/</link><pubDate>Tue, 18 Jul 2017 06:58:06 +0000</pubDate><guid>https://codingblast.com/asp-net-core-mvc-form-tag-helpers/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;We already talked about &lt;a href="https://codingblast.com/asp-net-core-tag-helpers/"&gt;Tag Helpers&lt;/a&gt;, we mentioned some of the most used Tag Helpers and we also talked about &lt;a href="https://codingblast.com/asp-net-core-mvc-caching-taghelpers/"&gt;caching Tag Helpers&lt;/a&gt;. In this post, we will talk about form Tag Helpers.&lt;/p&gt;
&lt;p&gt;HTML or Web Form is used to collect an input from the user using various HTML elements like inputs, checkboxes, radio buttons, dropdown lists, etc. When using the &lt;strong&gt;&lt;form&gt;&lt;/strong&gt; HTML element we are usually talking about POST request, even tho we could use GET. However, GET is recommended for short, non-sensitive, amounts of data usually used to fetch some data based on provided parameters.&lt;/p&gt;</description></item><item><title>ASP.NET Core MVC &amp;#8211; Caching Tag Helpers</title><link>https://codingblast.com/asp-net-core-mvc-caching-taghelpers/</link><pubDate>Fri, 07 Jul 2017 23:24:10 +0000</pubDate><guid>https://codingblast.com/asp-net-core-mvc-caching-taghelpers/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Caching can significantly improve our application load time and responsiveness. What can we cache with cache Tag Helpers? Well, we cache HTML content. We usually cache content that does not change frequently.&lt;/p&gt;
&lt;p&gt;In one of the &lt;a href="https://codingblast.com/asp-net-core-tag-helpers/"&gt;previous posts&lt;/a&gt;, we talked about &lt;a href="https://codingblast.com/asp-net-core-tag-helpers/"&gt;Tag Helpers&lt;/a&gt;. We saw what Tag Helpers do, how we can use them and we saw how do we use some of the most used Tag Helpers.&lt;/p&gt;</description></item><item><title>dotnet CLI - how to update a NuGet package and add a new NuGet package</title><link>https://codingblast.com/update-nuget-package-dotnet-cli/</link><pubDate>Thu, 06 Jul 2017 22:00:43 +0000</pubDate><guid>https://codingblast.com/update-nuget-package-dotnet-cli/</guid><description>&lt;h2 id="adding-and-updating-nuget-packages-via-command-line---dotnet-cli"&gt;Adding and updating NuGet packages via command line - dotnet CLI&lt;/h2&gt;
&lt;p&gt;Just like we can add, remove and update NuGet packages via UI in Visual Studio or Visual Studio Code we can accomplish the same using the dotnet CLI.&lt;/p&gt;</description></item><item><title>ASP.NET Core MVC - All about Tag Helpers</title><link>https://codingblast.com/asp-net-core-tag-helpers/</link><pubDate>Sat, 01 Jul 2017 18:21:47 +0000</pubDate><guid>https://codingblast.com/asp-net-core-tag-helpers/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Tag Helpers provide us with means to change and enhance existing HTML elements in our views. Therefore, we add them to our views, and afterwards, they are processed by the Razor Templating engine which in return creates an HTML and serves it to the browser. Few Tag Helpers actually act as elements or actual tags (environment, cache, etc.).&lt;/p&gt;</description></item><item><title>Middleware in ASP.NET Core - Handling requests</title><link>https://codingblast.com/asp-net-core-middleware/</link><pubDate>Sun, 18 Jun 2017 09:10:39 +0000</pubDate><guid>https://codingblast.com/asp-net-core-middleware/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Middleware is software that application assembles into the pipeline to handle requests and responses. Each part chooses whether to pass the request on to the next part in the pipeline, and can do certain actions before and after application invokes the next part in the pipeline. Request delegates usage is to build the request pipeline.&lt;/p&gt;</description></item><item><title>Logging in ASP.NET Core - Connecting the pieces</title><link>https://codingblast.com/asp-net-core-logging/</link><pubDate>Tue, 06 Jun 2017 18:36:04 +0000</pubDate><guid>https://codingblast.com/asp-net-core-logging/</guid><description>&lt;h2 id="logging-in-aspnet-core-1"&gt;Logging in ASP.NET Core 1&lt;/h2&gt;
&lt;p&gt;Logging has been a built-in feature since the first release of ASP.NET Core. Good thing about logging is that ASP.NET Core configures it to log internal events from the platform.&lt;/p&gt;</description></item><item><title>ASP.NET Core 2.0 Preview 1 introduction</title><link>https://codingblast.com/asp-net-core-2-preview/</link><pubDate>Sun, 14 May 2017 09:39:08 +0000</pubDate><guid>https://codingblast.com/asp-net-core-2-preview/</guid><description>&lt;p&gt;Few days ago at &lt;a href="http://build.microsoft.com/"&gt;Build conference&lt;/a&gt; we got some good news: .NET Core 2.0 Preview 1 and ASP.NET Core 2 Preview1 were announced.&lt;/p&gt;
&lt;p&gt;We will take a look at some new exciting features that are coming to ASP.NET Core world. Lets see what goodies ASP.NET Core 2 brings for us developers!&lt;/p&gt;</description></item><item><title>RxJS - Part 6 - Chat application with RxJS</title><link>https://codingblast.com/rxjs-chat-application-angular-socket-io/</link><pubDate>Fri, 12 May 2017 07:36:06 +0000</pubDate><guid>https://codingblast.com/rxjs-chat-application-angular-socket-io/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/rxjs/"&gt;first post&lt;/a&gt; of RxJS series we talked about reactive programming and benefits or RxJS. &lt;a href="https://codingblast.com/rxjs-observable/"&gt;Second post&lt;/a&gt; covered Observable and how we can effectively use and manipulate Observables. After that, in &lt;a href="https://codingblast.com/rxjs-operators/"&gt;third post&lt;/a&gt; we tried to get familiar with RxJS operators. We tried to briefly cover the &lt;a href="https://codingblast.com/rxjs-error-handling/"&gt;error handling&lt;/a&gt; subject in the &lt;a href="https://codingblast.com/rxjs-error-handling/"&gt;fourth post&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Chat Application with Angular and Socket.IO</title><link>https://codingblast.com/chat-application-angular-socket-io/</link><pubDate>Mon, 08 May 2017 06:47:39 +0000</pubDate><guid>https://codingblast.com/chat-application-angular-socket-io/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;We will use RxJS, Angular, express (Node.js) &amp;amp; Socket.IO to make a chat application. We will get to see how useful RxJS can be in this scenario. For the purpose of making things smooth and easy we will be using &lt;a href="https://codingblast.com/angular-cli/"&gt;Angular CLI&lt;/a&gt; to generate basic client structure and get us a boilerplate for simplest working Angular application. On the back-end we will use &lt;em&gt;Node.js&lt;/em&gt; with &lt;em&gt;express&lt;/em&gt; and &lt;em&gt;Socket.IO&lt;/em&gt;. Reasoning behind this is that Socket.IO is very easy to set up and work with. Furthermore, it provides both server and client side libraries. Socket.IO primarily uses WebSocket protocol to enable real-time bidirectional communication.&lt;/p&gt;</description></item><item><title>RxJS - Part 5 - RxJS error handling</title><link>https://codingblast.com/rxjs-error-handling/</link><pubDate>Thu, 04 May 2017 07:50:44 +0000</pubDate><guid>https://codingblast.com/rxjs-error-handling/</guid><description>&lt;h2 id="error-handling"&gt;Error handling&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/rxjs/"&gt;first post&lt;/a&gt; we saw that we have 3 main methods on Observer object: &lt;code&gt;next&lt;/code&gt;, &lt;code&gt;error&lt;/code&gt; and &lt;code&gt;complete&lt;/code&gt;. Lets focus on &lt;em&gt;error()&lt;/em&gt; method. When does it gets called? Lets see the code example.&lt;/p&gt;</description></item><item><title>RxJS - Part 4 - Operators</title><link>https://codingblast.com/rxjs-operators/</link><pubDate>Sun, 30 Apr 2017 20:24:36 +0000</pubDate><guid>https://codingblast.com/rxjs-operators/</guid><description>&lt;h2 id="rxjs--operators-introduction"&gt;RxJS Operators introduction&lt;/h2&gt;
&lt;p&gt;This time we are going to talk about operators. If you are not familiar with RxJS you should read first post in the series - &lt;a href="https://codingblast.com/rxjs/"&gt;introductory post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are many different ways to deal with asynchronous data. We could use callback functions or promises. Also, we could use &lt;a href="https://codingblast.com/generators/"&gt;generators&lt;/a&gt; and make our life easier by writing code that deals with asynchronous data in a synchronous manner. However, when we are using RxJS, operators are primary tool for manipulating and dealing with data. Consequently, main benefit of RxJS is various range of operators it supports.&lt;/p&gt;</description></item><item><title>RxJS - Part 3 - Hot and Cold Observable</title><link>https://codingblast.com/hot-and-cold-observable/</link><pubDate>Thu, 27 Apr 2017 22:23:59 +0000</pubDate><guid>https://codingblast.com/hot-and-cold-observable/</guid><description>&lt;h2 id="hot-and-cold-observable"&gt;Hot and cold Observable&lt;/h2&gt;
&lt;p&gt;While working with RxJS you will definitely run into these two terms - &lt;em&gt;hot&lt;/em&gt; and &lt;em&gt;cold&lt;/em&gt; Observable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hot observable&lt;/strong&gt; produces items regardless of the subscribers. Even if no one subscribed it will produce values. Such example is mouse move event. Mouse move occurs whether someone is listening or not.&lt;/p&gt;</description></item><item><title>RxJS - Part 2 - Observable</title><link>https://codingblast.com/rxjs-observable/</link><pubDate>Mon, 24 Apr 2017 10:00:59 +0000</pubDate><guid>https://codingblast.com/rxjs-observable/</guid><description>&lt;h2 id="observable-creation"&gt;Observable creation&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://codingblast.com/rxjs/"&gt;first post&lt;/a&gt; we saw how we can work with simple data sources and create an Observable from them. In this post we will see how can create Observable using various sources and methods available on Observable object.&lt;/p&gt;</description></item><item><title>RxJS - Part 1 - Introduction</title><link>https://codingblast.com/rxjs/</link><pubDate>Fri, 21 Apr 2017 07:18:01 +0000</pubDate><guid>https://codingblast.com/rxjs/</guid><description>&lt;h2 id="introduction-to-rxjs"&gt;Introduction to RxJS&lt;/h2&gt;
&lt;p&gt;Reactive programming is nothing new in programming world. It has been used over 40 years ago or even before that. It started to bloom recently along with micro-services and functional programming. Idea is that we have something that represents a value &lt;em&gt;over time&lt;/em&gt; which might constantly change. Most of the time when working with reactive programming we will be dealing with asynchronous programming. Even before Angular 2.0 was released Google or precisely Angular team decided to adopt and use RxJS internally in their framework. Since then it has grown rapidly in popularity.&lt;/p&gt;</description></item><item><title>Introduction to Angular CLI</title><link>https://codingblast.com/angular-cli/</link><pubDate>Tue, 18 Apr 2017 20:16:40 +0000</pubDate><guid>https://codingblast.com/angular-cli/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this post we will get familiar Angular CLI. We will go through some examples and see what kind of things we can do with it and how it can make our life easier and save us some time.&lt;/p&gt;</description></item><item><title>Generators in JavaScript - Introduction</title><link>https://codingblast.com/generators/</link><pubDate>Sat, 15 Apr 2017 19:29:55 +0000</pubDate><guid>https://codingblast.com/generators/</guid><description>&lt;h2 id="introduction-to-generators"&gt;Introduction to generators&lt;/h2&gt;
&lt;p&gt;A generator function is a special kind of function that was introduced in ES2015 (ES6). In JavaScript once we start a function it has to run to its completion. However, generator functions enable us to create functions that another code can reenter multiple times. Furthermore, nothing from outside of the generation function can make it exit/pause. Generator function pauses itself when it runs into a &lt;code&gt;yield&lt;/code&gt; expression. Once a execution reaches &lt;code&gt;yield&lt;/code&gt; expression, generator can not continue execution on its own. Something from &lt;em&gt;outside&lt;/em&gt; has to &lt;em&gt;continue&lt;/em&gt;its execution.&lt;/p&gt;</description></item><item><title>JavaScript Iterators</title><link>https://codingblast.com/iterators/</link><pubDate>Wed, 12 Apr 2017 19:40:44 +0000</pubDate><guid>https://codingblast.com/iterators/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When we talk about iterators there are two main protocols to be aware of: &lt;em&gt;iterables&lt;/em&gt; and &lt;em&gt;iterators&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Iterables are data structures that can be iterated. Such example is array, since we can loop through every element of array.&lt;/p&gt;</description></item><item><title>JavaScript Symbols</title><link>https://codingblast.com/javascript-symbols/</link><pubDate>Sun, 09 Apr 2017 08:29:06 +0000</pubDate><guid>https://codingblast.com/javascript-symbols/</guid><description>&lt;h2 id="javascript-symbols---introduction"&gt;JavaScript Symbols - Introduction&lt;/h2&gt;
&lt;p&gt;Symbol is a primitive data type in JavaScript. Symbols represent a way to define object keys that will never get in conflict with other keys.&lt;/p&gt;
&lt;p&gt;Since they are one of the primitive data types they are immutable.&lt;/p&gt;</description></item><item><title>Decorators with TypeScript</title><link>https://codingblast.com/decorators-intro/</link><pubDate>Thu, 06 Apr 2017 10:55:26 +0000</pubDate><guid>https://codingblast.com/decorators-intro/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;JavaScript decorators are a special kind of declaration. Decorators can be attached to both class declaration and class method declaration. Furthermore, they can be attached to accessor and property declaration. Finally, they can also be attached to parameter declaration.&lt;/p&gt;</description></item><item><title>Tuples in TypeScript</title><link>https://codingblast.com/typescript-tuples/</link><pubDate>Mon, 03 Apr 2017 08:31:37 +0000</pubDate><guid>https://codingblast.com/typescript-tuples/</guid><description>&lt;h1 id="tuples-in-typescript"&gt;Tuples in TypeScript&lt;/h1&gt;
&lt;p&gt;With tuples we can define what type of data (variable type) can be stored in every position ( or few starting positions ) inside of an array. Once you define the tuple you can then use it to declare variables.&lt;/p&gt;</description></item><item><title>Intersection types in TypeScript</title><link>https://codingblast.com/typescript-intersection-types/</link><pubDate>Fri, 31 Mar 2017 07:30:12 +0000</pubDate><guid>https://codingblast.com/typescript-intersection-types/</guid><description>&lt;h2 id="intersection-types"&gt;Intersection types&lt;/h2&gt;
&lt;p&gt;Purpose of this post is to get a basic understanding of intersection types and realize pros and cons of intersection types.&lt;/p&gt;
&lt;p&gt;Last time we talked about &lt;a href="https://codingblast.com/typescript-union-types-type-guards-type-aliases/"&gt;union types&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;let x: string | number;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Variable &lt;em&gt;x&lt;/em&gt; can be either &lt;em&gt;string&lt;/em&gt; or a &lt;em&gt;number&lt;/em&gt;. Consequently, you can use type guarding technique to exclude one of the types.&lt;/p&gt;</description></item><item><title>TypeScript - Union types, type guards and type aliases</title><link>https://codingblast.com/typescript-union-types-type-guards-type-aliases/</link><pubDate>Mon, 27 Mar 2017 18:23:11 +0000</pubDate><guid>https://codingblast.com/typescript-union-types-type-guards-type-aliases/</guid><description>&lt;h2 id="union-types"&gt;Union types&lt;/h2&gt;
&lt;p&gt;We can use union types in TypeScript to combine multiple types into one type:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;let text: string | string[];&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Variable &lt;strong&gt;text&lt;/strong&gt; can now be either string or string array which can be pretty handy in some particular cases.&lt;/p&gt;</description></item></channel></rss>