Making things invisible in CSS

This post will teach you the 3 ways to make elements invisible in CSS. Each one behaves differently and has it own use case. Let me introduce you to the display, visiblity and opacity properties. CSS display property Every element on a page is a box (rectangle). Display specifies behavior of this box and how to renders on page. There are many values that can be used (full list here), but there are just a few commonly used, e.g.: ...

August 5, 2018 · 3 min · Zbigniew

ASP.NET Core routing introduction

This article will introduce you to the concept of routing in ASP.NET Core framework. What is routing? Simply said routing is a process of mapping URLs to controllers and actions. If you’ve ever wondered how does your app “know” that /Home/Index request should be handled by HomeController.Index method then routing is the answer. You can make special routes, which allow you to provide additional parameters as a part of url. A common example is an “id”. In the “old days” URLs looked like this: http://localhost/page?id=1 now you can easily map it to more human friendly http://localhost/page/1 or even http://localhost/page/about-us. ...

July 22, 2018 · 8 min · Zbigniew

Entity Framework Core Snapshot

In this article you’re going to learn what is a mysterious <DBName>Snapshot.cs file in your solution. I’m going to teach you why snapshot file exists and how it relates to migrations. Introduction to migrations You create new app which requires a database. But you change the model (classes) often so every time you change your model (e.g. you add new column) you need to update your database schema. It’s a lot of work, but there’s a way to automate it. ...

June 3, 2018 · 3 min · Zbigniew

Learn/Teach LINQ using TDD/TDL

Long time ago I’ve created a project which purpose is to teach LINQ using tests. Technically it’s not exacly TDD. I’d rather call it TDL (test-driven learning), an “invention” of my own ;) Before we start let me point you to source code located on my GitHub repository. Learning LINQ The basics of LINQ are fairly easy. We have to learn how to filter, sort and project data. It can be used in two ways: the method syntax and the query syntax. This can feel weird in the beginning. Method syntax is my prefered way of using LINQ. I also think that LINQ newbies should start with it. ...

May 20, 2018 · 3 min · Zbigniew

ASP.NET Core ajax modals with validation using Bootstrap

In this tutorial I’m going to show you how to load modals dynamically and how to process forms (within modals) via ajax requests. I’m going to use Bootstrap for modals, because it’s pretty popular, but you may as well use any other UI framework or library for displaying modals. We’ll use jQuery to send ajax and perform modal actions. For the backend, we’ll use .NET Core MVC, but you can replace it with your technology of choice. The keypoint here for you is to find a way to return partial view (that is only HTML of a modal, without the whole layout) and to validate data. ...

May 13, 2018 · 13 min · Zbigniew