Time Zones Supported By .NET on Windows 10

For some reason I had a hard time finding a list of the Time Zones supported in .NET. Apparently this is because they are defined in the registry at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones on Windows, and in the ICU library on Linux and macOS. I fired up LinqPad and quickly retrieved these using TimeZoneInfo.GetSystemTimeZones() ReadOnlyCollection<TimeZoneInfo> (138 items)4 BaseUtcOffset DaylightName DisplayName Id …

EF Core – Get the db schema name of an Entity

I’m currently working on a project using EF Core, and the database uses various schema names to segregate data types.  I was having a hard time finding a way at run-time (in and override of SaveChanges() actually) to get back out the schema name of the table associated with an entity.  This was the best I could come up with …

AspNetCore Controller Return Types that Implement IActionResult

On my current project, we return Task<IActionResult> in the controller actions.  It makes it fairly painless to write useful unit tests. Middleware Pipeline  – a common location for returning errors, like via SetForbiddenResponse() Because I was having issues locating these in MSDN (not there, look in https://docs.microsoft.com/en-us/aspnet/core/api instead), here’s a list of valid types that implement IActionResult in AspNetCore (dotnet …