How to include a DateTime format as a constant 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.
What are attributes in C#, and why do we need them? 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...
How do you compare two objects in C#? (testing for equality) It's common to need to compare two objects for equality, such as when detecting changes before a save operation. What does it mean to define equality in C#? What is given to you out of the box, and what can you define yourself? Let's take a look!
What is implicit vs explicit conversion? Following an answer I gave on SO, I thought I'd write up a brief explanation of implicit and explicit conversion in C#.
The Obsolete attribute on a class is ignored when an interface is involved The effect of the Obsolete attribute on a class is ignored when there's an interface involved. It caught me by surprise, but on second thought makes complete sense!
An extension method for passing a column name to SqlDataReader.GetFieldValue There are two SqlDataReader.GetFieldValue methods - one that accepts an ordinal value and returns a specific type, and one that accepts a column name but returns an object. Let's try to have the best of both worlds, passing in a column name and getting back a specific type.