Using a constant as a DateTime format inside string interpolation I was upgrading some code to use string interpolation, a feature introduced in C# 6, when I ran into a small snag with DateTimes and a format string stored as a constant.
Using Attributes in C# Ever thought it'd be convenient to attach metadata to your code at design time, then read it at runtime? Attributes let you do just that - to methods, classes, tests, enumerations, and more. Use reflection to read them at runtime and take some action. Here's a few examples for the uninitiated...
Comparing Two Objects for Equality in C# It's common to compare two objects in C# for equality, such as for a save operation. Let's take a closer look at how we define what equal means.
Implicit vs Explicit Conversion in C# We use implicit and explicit conversion in C# all the time, without even realizing it. Let's learn more about them and look at examples of each.
Obsolete Attribute on a Class is Ignored When an Interface is Involved The Obsolete attribute on a class is ignored when an interface is involved. It caught me by surprise, but makes sense. Let's see why.
An Extension Method to Pass a Column Name to SqlDataReader.GetFieldValue Let's combine the SqlDataReader's GetFieldValue and GetOrdinal methods into an extension method that lets us pass a column name and get back a specific type.
Passing Data Between Forms in WinForms Passing data between two Forms is very common in WinForms. There's a couple ways to do it, and one's better than the other. Let's take a look.