C#

Thumbnail

Before I was a .NET developer I wrote almost exclusively in C++ for Microsoft Windows. I did that for well over a decade, which was long enough to build up a fairly sizeable collection of classes and libraries for myself. […]

JSON Extensions

Sometimes when I create a NUGET package it’s because I’ve written code to isolate my architecture from some 3rd party component that I’m using today, but, may want to move away from at some later point. My CG.Json NUGET package […]

LINQ library – Part 5

Last time I covered the internals of my SQL-Server unit-of-work strategy. I also demonstrated how that strategy could be plugged into a unit-of-work using a working bit of example code. This time I’ll quickly cover my SQL-Lite and in-memory strategies. […]

LINQ library – Part 4

Last time we walked through the EntityFrameworkUnitOfWorkStrategyBase class, and saw how it implements the behaviors that are common to any flavour of Entity Framework database strategy, whether that be for SQL-Server, SQL-Lite, or in-memory. This time, we’ll see how the […]

LINQ library – Part 2

Last time I talked about the background and purpose for my LINQ library, which provides a thin CRUD layer over a variety of database technologies. I covered the unit-of-work part of that library, along with the internals for the corresponding […]

LINQ library – Part 1

Background Most of the time when I’m writing database code on behalf of a customer, I do what most .NET developers probably do, which is to write a repository class and then implement it using either ADO.NET classes, or Entity […]

Temporary File Stream

Photo by Dil Assi on Unsplash One of the tools I use for generating temporary files is a class I wrote about eight years ago called TempFileStream. The class combines several useful aspects of working with temporary files, including: (1) code to generate […]

Mixed Base Formatter

Photo by Ales Nesetril on Unsplash Introduction The .NET framework provides a variety of options for converting objects, enums and structs into string representations. The trusty ToString method is always handy and, of course, there are plenty of variants that allow for the […]