Programming on the Microsoft .NET stack with C#.

Articles:

Simplified Sproc Calls with EF8

EF8 allows for raw SQL queries return mapped to CLR type, without including them type in the EF model. This make sproc call easier.
2/26/2024

Sending Authentication Cookies in a WPF app

WPF applications which simulate HTTP traffic at times need to handle cookie-based authentication. This is a quick recipe for cookie passing.
2/12/2024

LINQ's let keyword

LINQ comes in two flavors: Query Syntax and Method Syntax. The let keyword in Query Syntax helps keep code more readable.
12/14/2023

Trick question: The difference between an int and a struct?

Click for the answer.
8/21/2023

Dictionary.GetValueOrDefault - Wish I had that sooner...

In C#, I've always wished the Dictionary Indexer would simple return null if a key doesn't exist. The GetValueOrDefault extension is a good alternative.
7/28/2023

C# 10 Favorites

A few of my favorite C# 10 additions
8/25/2022

Your most important Xamarin Converter: InverseBoolConverter

Almost every Xamarin (and soon MAUI) app will need to display two different Elements (Label, StackLayout, etc...) based on a single bool property. Two ways to implement this are presented. InverseBoolConverter is preferred.
7/19/2022

A case for NOT using Dependency Injection <gasp!>

DI is certainly a powerful design pattern. However not all projects are created equal, and the "right tool for the job" always applies. I've found one case for not using Dependency Injection.
4/5/2022

A simple .NET Core WebAPI DB connection string configuration

Typical .NET Core WebAPI apps heavily rely on dependency injection. For my simple WebAPI, this made DB connection strings more complicated than I preferred. Here's my solution.
4/4/2022

Where was [CallerArgumentExpression] when I needed it?

CallerArgumentExpressionAttribute can be used within functions to determine the original variable name of passed in arguments...would have been nice to have in .NET Framework 4!
1/25/2022

The if-cast-null-check feature for C#

I can't recall how many times I cast an object then checked for null on it prior to use. This feature would have been handy all these years!

1/13/2022

Gracefully handle null numerals with GetValueOrDefault()

When dealing with nullable numerals, GetValueOrDefault() can simplify code a bit.
11/22/2021
(See all articles...)


  • C#/.NET/Core
  • T-SQL
  • HTML/Javascript/jQuery
  • ASP.NET/MVC
  • .NET Core
  • ADO.NET/EF
  • WPF
  • Xamarin/MAUI
  • Windows 10
  • SQL Server 20xx
  • Android
  • XBox One
  • Skiing
  • Rock Climbing
  • White water kayaking
  • Road Biking