C# Traps and Traps

Recently, on behalf of my employer, I spoke at the IT Academics Day, a small .NET conference organized by the West Pomeranian University of Technology. Together with Mateusz, we have presented some of the traps that a C# developer might encounter and how to recover from those. I would like to share three of ten such traps in today’s blog post, the rest will follow.

When inheritance is dangerous

The first one is a dangerous design trap, a bomb with a long fuse. Let’s take a look at the following code:

internal class BaseData
   protected string data = null;

   public BaseData(string data)
       this.data = data;

       Console.WriteLine("BaseData created");

   public virtual void InitializeState()
       // Some basic initialization logic.

Do you see anything dangerous yet?

Continue reading “C# Traps and Traps”

Using validation attributes in .NET Core

There are a number of ways you can implement validation of your forms, models or uploads. One of the most common methods of doing that is using validation attributes. Not only are they very easy to use, they can also be customized freely according to your business’ requirements. Today we’ll take a closer look at how to use them based on a real-life example from our project.

Continue reading “Using validation attributes in .NET Core”

A taste of SignalR Core

What is SignalR?

The beginnings

ASP.Net (both “bare” Web Forms and ASP.Net MVC introduced later) is developed around a traditional HTTP request and response mechanism –
the server provides content in form of HTML pages or files only when they are being requested by client. In contrast, SignalR provides two-way communication between server and client – both can trigger actions in each other and the result can be shown immediately in a browser without the need for refreshing.
The last part assumes that there is a browser involved – which doesn’t necessarily has to be true, as apart from javascript implementation of SignalR, a C# one (with more already announced) exists – SignalR isn’t constrained to just web pages.

One of the main selling points of SignalR was its simplicity of use. With just a few lines of code, it was easy to set up a simple chat. (And not only that – one of the examples provided by Microsoft was a browser multiplayer shooter game).

Continue reading “A taste of SignalR Core”

Introduction to Entity Framework Core

What is Entity Framework?

For those who never stumbled upon Entity Framework, it is Object-Relational Mapping (ORM) framework. Its main purpose is to provide an abstraction of a database, so you can use the database as if using normal in-memory data collections.

In practice, you still need to be mindful of what you do write your LINQ upon, especially time-wise. However, the simplicity of building a database-powered persistence is stunning and, in my opinion, worth investing your time required for learning this framework.

Continue reading “Introduction to Entity Framework Core”

ASP .NET Core – Introduction

The origins…

Microsoft has released the first version of ASP.NET together with .NET 1.0 in 2002. That version was focused on so called “Web Forms”. The main idea was to give the web-developer the same look and feel as he would have had while working with a usual windows application. So he got the designer file for a user interface, on which he could drag & drop controls, having code-behind executing logic underneath on the server side.

Continue reading “ASP .NET Core – Introduction”


The goals of this blog.

Once in a while, an engineer reflects on his or her career and ask the question: what next? The honest answer could guide our professional development for next few years that follow. I, together with my friends, answered that question in a similar fashion, so we have formed a team.

Some of us are professional developers, some are scientists and some are at the doorstep of a programmer career. Although we have different backgrounds, we have discovered that we share the same goals.

Continue reading “Introduction”