Blog

Page 470 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Best practice to call ConfigureAwait for all server-side code
async-awaitc#

Best practice to call ConfigureAwait for all server-side code

Published on September 2, 2023

# Best practice to call ConfigureAwait for all server-side code šŸ¤” Are you working with server-side code that involves asynchronous functions? Do you want to optimize the performance of your code while avoiding potential problems? Then you might have come

Cover Image for When to use static classes in C#
c#classstatic

When to use static classes in C#

Published on September 2, 2023

# When to Use Static Classes in C# Static classes in C# can be very useful in certain scenarios. They provide a way to organize methods that are not associated with specific objects, and can make your implementation simpler and faster. However, it's impor

Cover Image for SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session
c#inversion-of-control

SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session

Published on September 2, 2023

# 🚨 Solving the "New transaction is not allowed because there are other threads running in the session" error 🚨 If you're encountering the `SqlException` with the message "New transaction is not allowed because there are other threads running in the ses

Cover Image for C# Interfaces. Implicit implementation versus Explicit implementation
c#.net

C# Interfaces. Implicit implementation versus Explicit implementation

Published on September 2, 2023

šŸ“ **C# Interfaces: Implicit Implementation vs Explicit Implementation** Have you ever wondered about the differences between implementing interfaces implicitly and explicitly in C#? šŸ¤” In this blog post, we will dive into this question and provide easy s

Cover Image for How do I make a textbox that only accepts numbers?
c#.net

How do I make a textbox that only accepts numbers?

Published on September 2, 2023

šŸ“ Title: "How to Create a Number-Only Textbox in your Windows Forms App" Introduction: šŸ‘‹ Hey there! Are you struggling to figure out how to make a textbox in your Windows Forms app that only accepts numbers? Look no further, because we've got you covere

Cover Image for How do you do a deep copy of an object in .NET?
c#clone.netserialization

How do you do a deep copy of an object in .NET?

Published on September 2, 2023

# Title: "Mastering the Art of Deep Copy in .NET: A Hassle-Free Guide šŸŽÆ" --- ## Introduction So, you want to perform a **deep copy** of an object in the .NET world, huh? You've come to the right place! šŸš€ Java may have made it easy, but worry not, my

Cover Image for Func delegate with no return type
c#.net

Func delegate with no return type

Published on September 2, 2023

# šŸ¤” Func Delegate with No Return Type? Can It Be Done? So you're working with C# and you've heard about the handy `Func` delegates that can be used with methods to return a value. But what about those times when you need to work with methods that don't r

Cover Image for Difference between InvariantCulture and Ordinal string comparison
c#.net

Difference between InvariantCulture and Ordinal string comparison

Published on September 2, 2023

# Understanding the Difference between InvariantCulture and Ordinal String Comparison šŸ’„šŸ” <p>So, you want to compare two strings for equality in C#, but you're not sure whether to use InvariantCulture or Ordinal comparison. Fear not, my fellow tech enthu

Cover Image for Calculate the execution time of a method
c#io.net

Calculate the execution time of a method

Published on September 2, 2023

# Calculating the Execution Time of a Method: A Simple Guide Are you curious about how long a particular method takes to execute in your code? Running time calculations can help you identify performance bottlenecks, optimize your code, and ultimately impr

Cover Image for Adding values to a C# array
arraysc#

Adding values to a C# array

Published on September 2, 2023

# Adding Values to a C# Array: A Beginner's Guide āœØšŸ’» Are you new to C# and struggling to add values to an array? Don't worry, we've got you covered! In this blog post, we'll walk you through the process step by step, addressing common issues and providin