Author: Marinko Spasojevic

C# Back to Basics – Type Conversion

In C#, data can be converted from one type to another by using an implicit conversion (automatic) or an explicit conversion (we can choose how it’s done). For the complete navigation of this series check out: C# Back to Basics. So, let’s talk more about that. In this article, we are going to cover: Implicit Conversion Explicit Conversion Using the Convert Class Conclusion Implicit Conversion Many different data could be interpreted by using different types. For example, number 74 can be interpreted as an integer but also as double (74.0). There are two situations in which implicit conversion applies....

Read More

C# Basics – Operators in C#

In this article, we are going to talk about operators in C#, how to use them and what are the differences between each of them. For the complete navigation of this series check out: C# Back to Basics. In this article, we are going to cover: Type of Operators Arithmetic Operators Relational Operators Logical Operators Increment and Decrement Operators Conclusion Type of Operators The most used operators in C# are: Arithmetic Operators Arithmetic operators are defined for all the numeric data types. Operators +, -, *, / represent the basic binary arithmetic operations (addition, subtraction, multiplication and division). Operator...

Read More

C# Back to Basics – C# Data Types, Declarations and Variable Definitions

In C#, different data types are registered differently. Furthermore, different actions are allowed to be executed upon them as well. For different data types, a certain amount of memory space is reserved on our computer. With each data type we define: How to register data in memory The possible values for that data Possible actions on the data So, let’s talk more about data types in C#. For the complete navigation of this series check out: C# Back to Basics. In this article, we are going to cover: Data Type Registration Variables in C# Variable Declarations and Expressions Conclusion...

Read More

C# Basics – Development Environment Setup

In this article, we are going to talk about what IDE is and how we can use Visual Studio to create a new project. For the complete navigation of this series check out: C# Back to Basics. In this article, we are going to cover the following topics: Integrated Development Environment (IDE) Watch Window Conclusion Integrated Development Environment (IDE) IDE stands for Integrated Development environment. It is basically a tool that helps us develop applications more easily. It has many features that can make our lives easier. For example, some common features include: Source code editor Debugger Compiler Templates...

Read More

Global Error Handling in ASP.NET Core Web API

The exception handling features help us deal with the unforeseen errors which could appear in our code.  To handle exceptions we can use the try-catch block in our code as well as finally keyword to clean up resources afterward. Even though there is nothing wrong with the try-catch blocks in our Actions in Web API project, we can extract all the exception handling logic into a single centralized place. By doing that, we make our actions more readable and the error handling process more maintainable. If we want to make our actions even more readable and maintainable, we can...

Read More