Posts from 2019
2019-12-28 The Books I Read in 2019
2019 was one of my better years. I visited my family in Canada, I had a productive garden, and I worked for a good client writing useful and challenging software. Most importantly, my wife and I enjoyed good health and happiness.
One of my hobbies is reading and this year was a great reading year, one of the best that I can recall. Not only for the number of books, but also for the enjoyment and the insights and reflections they provided. Here is the list of them and a brief mention of the effect they had on me.
2019-12-22 Mocking EF Core
Some would argue that create mock objects for Entity Framework (EF) is no long necessary since EF Core provides an In-Memory Database Provider. But even the supporting documentation is a bit confusing of it’s use for unit testing:
This database provider allows Entity Framework Core to be used with an in-memory database. This can be useful for testing, although the SQLite provider in in-memory mode may be a more appropriate test replacement for relational databases.
2019-12-15 Using trunk-based development
For the past year I have worked on a project that uses trunk-based development. I thought I’d write down some of my observations and ideas about my experiences.
2019-11-30 Do I Write Good Tests?
When I write code, I always try to include unit tests. Sometimes I feel like they are good tests, and other times, I feel like I could have done better. Do I write good unit tests?
2019-11-24 Parsing Enum Values with ASP.NET Core
When you choose to use an enumeration in an ASP.NET incoming model, it is often desirable to convert the numerical representation to a string. The changes to how JSON is parsed in ASP.NET Core 3 means the way this parsing is done has changed.
2019-11-17 Eliminating Waste with .NET Core
In the last post I wrote some ideas about eliminating waste when developing software. With this post I’d like to specifically look at waste when developing .NET Core applications.
2019-11-10 Eliminating Waste
The Lean Software Development Principles advocate the elimination of waste in your development process. Let’s take a look at what forms waste can take and how to reduce or remove it. Specifically, when applied to .NET Core projects.
2019-11-03 Avoiding Primitive Obsession with Entity Framework Core
Primitive Obsession is when primitive types (int, decimal, string, DateTime, etc.) exist in a Domain Model. Using these data types can cause your domain logic to have a lot of additional code just to deal with these primitives. You can avoid this by using Value Objects and integrate them with Entity Framework Core is very straightforward.
2019-10-27 Managing Entity Framework Core Mappings
When building a data model using Entity Framework (EF) Core, you can quickly find that the default behavior is difficult to maintain. Let’s look at a better way to handle the large number of mapping data.
2019-10-20 Configuring Entity Framework Core
Entity Framework (EF) Core, provides a dizzying array of configuration options. In a Clean Architecture, configuring EF Core is straightforward. Let’s explore how.
2019-10-12 Using Entity Framework Core in a Clean Architecture
Incorporating persistence in a Clean Architecture is one of the more interesting aspects to consider. Entity Framework (EF) Core, the object-relational mapper (O/RM) Microsoft provides for .NET Core projects, is familiar to most developers. Let’s explore how to use it with our Clean Architecture where our Domain business logic is (almost) unaware of it’s existence.
2019-10-05 Using ASP.NET Core in a Clean Architecture
Having Domain business logic in an application is the first step in building with a Clean Architecture. Now let’s take a look at incorporating the application and UI layers. Specifically, the addition of the ASP.NET Core framework.
2019-09-29 The Center of a Clean Architecture
This is the second in a series of posts exploring the use of Clean Architecture principles to build an ASP.NET Core REST API application.
In the last post, we created a small .NET Core solution with a class library for the Domain business logic and a class library for the unit tests covering the business logic.
In this post I want to explore what goes into the Domain business logic. But more specifically, what doesn’t belong.
2019-09-21 Starting a Clean Architecture
Robert C. Martin (Uncle Bob) has written at length about what he calls a Clean Architecture. For awhile I wanted to explore these concepts in C#. Specifically a REST API built using ASP.NET Core. This is the first in a series of posts describing my experience.
2019-09-14 Time is the Enemy When Testing .NET
If your application uses time, then it is necessary for you to consider how your application thinks about time. It can be an enemy if you let it, but it can be a friend if you use it right.
2019-09-08 Launch Settings with ASP.NET Core
Here are some notes on how to override the
launchSettings.jsonin the Properties folder to control ASP.NET Core applications on your local workstation.
2019-09-04 Using Serilog with ASP.NET Core
Serilog is one of the more popular logging packages that integrates with ASP.NET Core. I have recently used Serilog on several RESTFUL API projects and I have found it to work extremely well with most logging needs.
2019-09-01 Injecting Configuration Settings in ASP.NET Core
ASP.NET Core has a very robust Dependency Injection (DI) framework. Configuring the application is always necessary at some level. Most applications have a need to inject configuration settings into the DI container for other classes to use. Let me show one way that has worked well for me.
2019-08-27 Dependency Injection in ASP.NET Core
Dependency Injection (DI) was something I read about several years ago and I didn’t really understand it well until I encountered ASP.NET MVC. Specifically, the way Autofac made it all work. I had used other DI containers, but it was using Autofac that really made it clear to me.