Blog

Page 471 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for async/await - when to return a Task vs void?
asynchronousc#

async/await - when to return a Task vs void?

Published on September 2, 2023

📝 Hey there tech enthusiasts! 👋 Have you ever wondered about the async/await keywords in C# and when to return a Task vs void? 🤔 Well, today we're diving deep into this topic to help you understand the best approach to handle async methods. So let's get

Cover Image for LEFT OUTER JOIN in LINQ
c#join

LEFT OUTER JOIN in LINQ

Published on September 2, 2023

# Performing a Left Outer Join in C# LINQ So you've encountered the need to perform a left outer join in C# LINQ, but you're not quite sure how to go about it. Don't worry, I've got you covered! In this blog post, I'll walk you through a common problem re

Cover Image for How do I get the color from a hexadecimal color code using .NET?
c#

How do I get the color from a hexadecimal color code using .NET?

Published on September 2, 2023

🖥️💡 How to Get Color from a Hexadecimal Color Code in .NET 💡🖥️ So, you've stumbled upon a hexadecimal color code like #FFDFD991 and now you're wondering how on earth you can turn this code into an actual color using .NET. Fear not, my fellow developer

Cover Image for jQuery and AJAX response header
ajaxjqueryredirect

jQuery and AJAX response header

Published on September 2, 2023

## 🤔 Understanding jQuery AJAX Response Headers So you've got this jQuery AJAX call and you're trying to handle a response that comes from the server in the form of a 302 redirect. You want to take this redirect and load it in an iframe. But there's a pr

Cover Image for C# difference between == and Equals()
c#.net

C# difference between == and Equals()

Published on September 2, 2023

# Exploring the Difference Between == and Equals() in C# 👥 So you're writing some C# code, and you encounter a situation where using `==` returns `false`, while `.Equals()` returns `true`. 🤔 What's going on here? Why are these two seemingly similar appr

Cover Image for How to ignore a property in class if null, using json.net
c#

How to ignore a property in class if null, using json.net

Published on September 2, 2023

# How to ignore a property in class if null, using json.net 🤔 Are you struggling with how to ignore a property in a class if it's null when serializing it to JSON using [Json.NET](http://www.newtonsoft.com/json)? Don't worry, we've got you covered! In th

Cover Image for How to check if a number is a power of 2
algorithmc#math.net

How to check if a number is a power of 2

Published on September 2, 2023

# How to Check If a Number is a Power of 2: The Ultimate Guide! 💪🔢 Are you tired of scratching your head when trying to figure out if a number is a power of 2? We've all been there! But worry no more. In this guide, we'll tackle this problem head-on and

Cover Image for How to determine if a type implements an interface with C# reflection
c#reflection

How to determine if a type implements an interface with C# reflection

Published on September 2, 2023

# 📝 Tech Talk: How to Determine if a Type Implements an Interface with C# Reflection 🤔💡 Hello tech enthusiasts! Today, we are diving into the intriguing world of C# reflection to address a common issue that developers often face: determining if a type

Cover Image for Why catch and rethrow an exception in C#?
c#exceptiontry-catch

Why catch and rethrow an exception in C#?

Published on September 2, 2023

# Why Catch and Rethrow an Exception in C#? 🤔💥 Exception handling is a crucial aspect of writing robust and reliable code in any programming language, including C#. While the code snippet you mentioned appears to be redundant, there are situations where

Cover Image for RedirectToAction with parameter
c#

RedirectToAction with parameter

Published on September 2, 2023

# 🚀 How to Redirect to an Action with a Parameter in ASP.NET MVC So, you're facing a challenge when it comes to redirecting to an action with a parameter in your ASP.NET MVC application. Fear not, my tech-loving friend, for I have some easy solutions to