Dev Corner

Diving deep into the code to solve your challenges and offer up expert tips
  • Category

  • Author

XlsToEf: When to use it and when not to

XlsToEf: When to use it and when not to

Have you ever had an existing application using Entity Framework and then needed to import some data from spreadsheets? Maybe it was even IMPORTANT that the import go through your existing entities. For example, a customer may want to upload updated lookup tables or...

How to make the most of your xUnit test

How to make the most of your xUnit test

We as software consultants know that testing is essential, but how can we make sure our tests are clean and work better for us? What do we do when we have to test the results of different input values for a single method? .NET test frameworks provide a consistent...

How the Bulk Writer library lets you load data faster

How the Bulk Writer library lets you load data faster

Quick—off the top of your head, how many times have you had to write code to move a bunch of data from an external source into your application database?  Was there a requirement that the process be fast?  Yeah, we both know the answer to that one. Really, shuffling...

How the Fixie test framework leverages developer ergonomics

How the Fixie test framework leverages developer ergonomics

TL;DR: The Fixie test framework reinvents .NET testing from a minimalist perspective. Eliminating complexity in its implementation has enabled a laser focus on smooth command line, IDE, and CI integrations. By placing developer ergonomics as the top priority, the end...

Solving .NET memory leaks in your IoC containers

Solving .NET memory leaks in your IoC containers

Have you ever had to deal with a .NET app that keeps crashing due to OutOfMemoryException? Or maybe it uses a lot more memory than you expect and you’re not quite sure why. .NET memory leaks aren’t supposed to be a thing, but we do still bear some responsibility for...

Cleaning up code: When to “Boy Scout” and when not to

Cleaning up code: When to “Boy Scout” and when not to

Our code should be clean. Yet, messes are made, left, hidden, forgotten, refound, buried, and then fed to the Ravenous Bugblatter Beast of Traal who then rains on our parade and ruins our release, wrecks our weekend—or all the above. How do we prevent this disaster?...

Real world use cases for default interface methods

Real world use cases for default interface methods

You already know that interfaces are meant to be immutable and should not be upgraded once released. Before C# 8.0, the best way to extend an interface was to create extension classes for adding default behaviors. But with default interface methods, you can skip the...

3 tips for tuning your skills with C# strings

3 tips for tuning your skills with C# strings

You may be guilty of taking strings for granted. They’re baked into the framework as a built-in type, and since almost every codebase uses them, they tend to just fade into the background. Throughout the years, though, I’ve seen people new to C# use strings in several...

Meaningful test coverage in .NET Core 3

Meaningful test coverage in .NET Core 3

Your tests come with a glowing code coverage report, but I’m not convinced. A subtle rot spreads through your tests without you even knowing it: your tests keep passing, your code coverage report keeps claiming health, but in fact, your tests drift further and further...

Refactoring code gets interesting with generics

Refactoring code gets interesting with generics

Duplication in code often arises organically and can cause problems like missing updates of the duplicated cases or just obscuring the actual flow through the code due to large amounts of boilerplate code. Refactoring code to eliminate duplication can take a bit of...

The fundamentals of Xamarin development

The fundamentals of Xamarin development

You’ve spent months or years building a robust web application with dozens of features and an established user base. One day, the boss visits and gives you a simple yet terrifying requirement: “We need a Xamarin app.” If you’ve only worked with MVC Web projects...

How to leverage a lightweight OpResult class

How to leverage a lightweight OpResult class

There are times in code when you need to return the results of an operation, but aren’t using a transport mechanism like HTTP that gives you a data structure with built-in statuses. In these situations, a lightweight OpResult class can be really helpful. The original...