JavaScript Collections – Set and Map

 Introduction In this post we will get familiar with two different collections in JavaScript: Set Map In one of the next posts we will also talk about two similar collections: WeakSet WeakMap   They were all introduced to JavaScript spec with ES2015, also known as ES6. Both Map and Set are iterable types. Just like […]

Continue reading

ASP.NET Core 2 – Global Model validation

How we (some of us?) do Model validation right now 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 ModelState property available on MVC’s base controller class: View the code on Gist. The […]

Continue reading

ASP.NET Core – Unit testing IAuthorizationService and dependencies inside of your controller

Unit Testing – IAuthorizationService, Requirement and Handler You have a controller that makes use of IAuthorizationService and you have a custom requirement – implementation of IAuthorizationRequirement. You might also have your custom handler which is an implementation of IAuthorizationHandler. As an honourable .NET Core citizen, you are doing some unit tests for your controller and […]

Continue reading

ASP.NET Core – InvalidOperationException: Cannot find compilation library location for package ‘Microsoft.Win32.Registry’

TL;DR Add following line to your .csproj file: <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> Introduction I was publishing a project I am working on to web server (Linux) and I had an issue with Razor Pages. However, it seems that this error occurs only when you precompile your Razor views (MVC views, Razor Pages). Why would you do that? Well, […]

Continue reading

Using React Router v4 with create-react-app

Introduction – react-router React-router is the most popular routing solution for applications made in React. It is a collection of navigational components that compose declaratively with your application. Bookmarkable URLs, history, customizable navigation links and quite a few other features come with it. I had a need to learn more about react-router v4 so I […]

Continue reading
1 2 3 11