Blog

Page 187 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Better way to check if a Path is a File or a Directory?
c#directoryfile.netpath

Better way to check if a Path is a File or a Directory?

Published on September 2, 2023

📝 **Title: Better way to check if a Path is a File or a Directory?** 📂📁🤔 Introduction: Hey tech adventurers! 👋 Are you struggling to determine whether a path is a file or a directory in your code? 🤔 Don't worry, you're not alone! Many developers hav

Cover Image for Is DateTime.Now the best way to measure a function"s performance?
c#datetime.netperformance

Is DateTime.Now the best way to measure a function"s performance?

Published on September 2, 2023

# 🕒 Is DateTime.Now the best way to measure a function's performance? 🤔 Are you trying to find out where your code is slowing down? 🤔 Need a reliable way to measure the performance of your functions? ⏱️ Look no further! In this blog post, we'll dive in

Cover Image for Deserialize JSON object into dynamic object using Json.net
c#.net

Deserialize JSON object into dynamic object using Json.net

Published on September 2, 2023

# Deserialize JSON Object into Dynamic Object using Json.net 🔄 So you want to deserialize a JSON object into a dynamic object using Json.net, huh? Well, you've come to the right place! In this guide, we will address this common issue, provide easy soluti

Cover Image for Difference between text and varchar (character varying)
stringtypes

Difference between text and varchar (character varying)

Published on September 2, 2023

# Text vs Varchar: Unraveling the Mystery 📚 Have you ever wondered what's the difference between the `text` and `varchar` (character varying) data types in PostgreSQL? 🤔 Don't worry, you're not alone! Many developers struggle to understand the nuances b

Cover Image for Difference between Math.Floor() and Math.Truncate()
math.net

Difference between Math.Floor() and Math.Truncate()

Published on September 2, 2023

# Math.Floor() vs Math.Truncate(): What's the Deal? 🤔 Are you a math whiz struggling to wrap your head around the differences between `Math.Floor()` and `Math.Truncate()` in .NET? Don't worry, you're not alone! It's a common question that often leads to

Cover Image for How do you unit test private methods?
.netprivatetddunit-testing

How do you unit test private methods?

Published on September 2, 2023

# How to Unit Test Private Methods: A Developer's Guide 👨‍💻 So, you're building a class library with some public and private methods, but you're wondering how to effectively unit test those private methods. You're in luck! In this blog post, we will exp

Cover Image for How do I truncate a .NET string?
c#.netstring

How do I truncate a .NET string?

Published on September 2, 2023

# Truncating a .NET String: Solving the Mystery 🕵️‍♂️✂️ Are you tired of struggling to truncate your .NET string? Do you find yourself constantly hitting exceptions and limitations? Fear not! We're here to save the day with a solution that is as simple a

Cover Image for Why is HttpClient BaseAddress not working?
c#.net

Why is HttpClient BaseAddress not working?

Published on September 2, 2023

# Why is HttpClient `BaseAddress` not working? 🤔 So you've come across the `BaseAddress` property in the `HttpClient` class and thought, "This is cool! I can set the base URL and make my code more concise." But then you realized, it's not working as expe

Cover Image for The name "ConfigurationManager" does not exist in the current context
c#.net

The name "ConfigurationManager" does not exist in the current context

Published on September 2, 2023

# Troubleshooting the 'ConfigurationManager' Error in ASP.NET+C# If you're an ASP.NET+C# developer, you may have encountered the frustrating error message "The name 'ConfigurationManager' does not exist in the current context." This error typically occurs

Blog | Matheus Mello