Moq makes testing this piece of code a breeze. Without it, I would have had to write a whole lot of essentially throwaway code just to test this three line controller action. Probably one or two orders of magnitude more code. Clearly, this tool which I relied on heavily prior to .NET Core, remains quite a powerful weapon in my arsenal in .NET Core.
“Microsoft.Data.Sqlite“, is an open source library and is also available as NuGet package. Here’s the Github source code for reference.