Author: Marinko Spasojevic

SOLID Principles in C# – Liskov Substitution Principle

The Liskov Substitution Principle (LSP) states that child class objects should be able to replace a parent class objects without compromising the application integrity. What this means essentially, is that we should put an effort to create such derived class objects which can replace objects of the base class without modifying its behavior. If we don’t, our application might end up being broken. Does this make sense to you? To make things clear, we are going to use a simple „Sum Calculator“ example, which will help us to understand how to implement the LSP better. To download the source...

Read More

SOLID Principles in C# – Open Closed Principle

The Open Closed Principle (OCP) is the SOLID principle which states that the software entities (classes or methods) should be open for extension but closed for modification. But what does this really mean? Basically, we should strive to write a code which doesn’t require modification every time a customer changes its request. Providing such a solution where we can extend the behavior of a class (with that additional customer’s request) and not modify that class, should be our goal most of the time. In this article, we will show you how to write the code by following the Open...

Read More

SOLID Principles in C# – Single Responsibility Principle

While developing a project, we strive to write maintainable and readable code (beside the working part 😀 ). To accomplish this, each and every class should do its own task and do it well. Yes, it is quite important for a class to have no more than one task. If it does, our code becomes harder to maintain, due to the fact that it is responsible for the execution of several different tasks and thus being more likely to change in the future. This is completely opposite from what the Single Responsibility Principle (SRP) states. The Single Responsibility Principle...

Read More

Uploading Files With .NET Core Web API and Angular

Being able to upload files and use them afterward is the required feature of many applications. Sometimes this is not a trivial task to accomplish. So, this is going to be the topic for this blog post. We are going to upload files to the server (.NET Core Web API part) and then to use those files in our Angular client app. In this post, we will stick to the images, but the logic is reusable for other file types as well. We have created the starter project to work with through this blog post and it can be...

Read More

.NET Core with SignalR and Angular – Real-Time Charts

SingalR is a library which helps us provide a real-time web functionality to our applications. This means that our server can push data to any connected client as soon as that data is provided, in a real-time, and vice verse. In this article, we are going to show you how to use SignalR with .NET Core and Angular through the practical example. We are going to simulate a real-time data flow by using the Timer class in .NET Core and use that data to change states of our Angular charts in real time as well. For this example, we are going...

Read More