Dev Corner

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

  • Author

Organizing Razor Pages with Vertical Slice Architecture

As software developers, we are always on the lookout for the better way. It’s what we have been doing since the invention of the computer and software programming. The pioneers of software development laid a strong foundation and throughout the years we have improved...

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

We all 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 answer to this...

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...

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

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

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 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 that code to eliminate duplication can take a...

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...