Blog

Page 528 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for How to convert Decimal to Double in C#?
c#decimalfloating-pointtype-conversion

How to convert Decimal to Double in C#?

Published on September 2, 2023

# Converting Decimal to Double in C#: A Simple Guide 😊 So, you're trying to assign a decimal variable to a double variable in C#, but you keep encountering the annoying "Cannot implicitly convert type decimal to double" error. Fret not! In this blog post

Cover Image for Setting Authorization Header of HttpClient
c#

Setting Authorization Header of HttpClient

Published on September 2, 2023

# Blog Title: šŸš€ Decoding the Mystery: Setting Authorization Header of HttpClient ## Introduction Are you struggling to set the Authorization header of HttpClient for your REST API? Don't fret! In this blog post, we'll dive into the common issues and pro

Cover Image for LINQ Aggregate algorithm explained
aggregatec#.net

LINQ Aggregate algorithm explained

Published on September 2, 2023

# 🧐 Understanding LINQ Aggregate Algorithm: A Simple and Comprehensive Explanation šŸ“ Have you ever found yourself scratching your head when trying to understand the `Aggregate` algorithm in LINQ? šŸ˜• Trust us, you're not alone! Many developers struggle t

Cover Image for How to get the type of T from a member of a generic class or method
c#generics.net

How to get the type of T from a member of a generic class or method

Published on September 2, 2023

# How to Get the Type of T from a Member of a Generic Class or Method šŸ˜Ž So you're working with a generic class or method and you want to know what type the generic parameter `T` represents? Fear not, my friend, for I have the solution you seek! šŸš€ ## Th

Cover Image for IEnumerable vs List - What to Use? How do they work?
c#list

IEnumerable vs List - What to Use? How do they work?

Published on September 2, 2023

# :rocket: IEnumerable vs List - What to Use? How do they work? Ever wondered about the difference between `IEnumerable` and `List` in C#? šŸ¤” Don't worry, you're not alone! These two types can be quite confusing, especially when it comes to their usage an

Cover Image for Split a string by another string in C#
c#.netsplitstring

Split a string by another string in C#

Published on September 2, 2023

šŸ”Ŗ Split a string by another string in C# šŸ”€ Have you ever tried splitting a string in C# using the `Split()` method, only to realize that it only works with individual characters as the delimiter? šŸ¤” Don't worry, you're not alone! Many developers have fa

Cover Image for Random number generator only generating one random number
c#random

Random number generator only generating one random number

Published on September 2, 2023

šŸŽ² Why is my random number generator only generating one random number? šŸŽ² So, you've got this funky random number generator that's supposed to give you different values each time you use it. But when you use it in a loop, all the values end up being the

Cover Image for Direct casting vs "as" operator?
c#casting

Direct casting vs "as" operator?

Published on September 2, 2023

# Direct casting vs 'as' operator: Which one should you use? šŸ¤” Have you ever come across a situation where you need to convert an object to a specific type in your code? If so, you might have wondered what is the best way to do it. In C#, we have three o

Cover Image for Func vs. Action vs. Predicate
c#

Func vs. Action vs. Predicate

Published on September 2, 2023

šŸ“ **Blog Post: Func vs. Action vs. Predicate - Understanding the Differences and Use Cases** Are you feeling confused about when to use a `Func`, an `Action`, or a `Predicate` delegate in your code? Don't worry, you're not alone! These delegates can some

Blog | Matheus Mello