Casting Between Custom Types in C#

This is a follow up from the article on Casting Custom Types To C# Built-In Types.

In the previous article we looked at how we would take a custom object like a Class or a Struct and cast it to a C# built-in like a bool. In this article we will look at how to cast from one custom type to another.

What we will be exploring here is much like what AutoMapper does.

Casting Custom Types To C# Built-In Types

Quick Quiz

What does the code below do?

CustomObject c1 = new CustomObject()
bool variableName = Convert.ToBoolean(c1);

//1. variableName is false
//2. runtime exception
//3. It depends

If you’re not sure what the answer is, read on - all will be clear.

Background Jobs with Hangfire in ASP.Net Core

This article discusses background jobs; what they are, why use them and how to set them up in an ASP.Net Core Web Application. There are several options for implementing background jobs but the framework of choice here is hangfire because of its ease of entry for beginners.


The takeaways from this article are:

  1. What background jobs are.
  2. What situation requires Background Jobs.
  3. How to use Hangfire to create background jobs in ASP.Net Core.

Dependency Injection in Asp.Net Core for Beginners - Part 1

There are a lot of concepts that beginner programmers encounter when they start to go beyond writing simple console applications in dotnet and maybe try to build a website. One of such concepts is Dependency Injection (DI).


After reading this article you will know the following:

  1. What dependency Injection is.
  2. Why we need dependency Injection.
  3. How we use/do dependency injection in dotnet core.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now