Entity Framework Core: Naming Convention

Note: I use the preview version of Entity Framework Core 2.0 (2.0.0-preview1-final). Things may change after the final version is released Entity Framework migration allows to generate the database schema from the model. This means the name of generated objects has to be inferred from the name of the classes and properties. The default names should be ok for lots of people. However, your DBA may ask you… [read more]

Cookie authentication in ASP.NET Core 2 without ASP.NET Identity

The default ASP.NET Core 2 web template provides lots of code to authenticate users. My screen is not big enough to display all the files in the solution explorer. The template offers lots of functionalities: users can log in using username/password or using an external provider such as Google or Microsoft. You can use two-factor authentication. And so on. You can rely on this code and use it as is. Or,… [read more]

Continuously publishing Nuget package to MyGet using VSTS

Step 1 - Create your NuGet feed using MyGet I use MyGet to publish my package for CI. The service is free as long as you don't exceed 500MB and it allows me to not polute NuGet.org with lots of in-development packages. Plus, the 500MB limits is very high and you can configure retention rules to automatically delete old package versions. Go to https://www.myget.org to create your first feed. Once you… [read more]

Enable BitLocker AES-XTX 256 encryption algorithm

The latest version of Windows 10 (1511) has introduced a new encryption algorithm AES-XTX. This version of AES is specific to encrypt hard drives. By default, Windows 10 1511 uses AES-XTX 128 to encrypt your hard drives. If you want to protect sensitive data, you may prefer using AES-XTX 256 algorithm. Let's see how to enable this algorithm. Open the Local Group Policy Editor Select Computer Configuration… [read more]

Post-Redirect-Get and TempData with ASP.NET Core

The Post-Redirect-Get (PRG) pattern prevents duplicate form submissions when the user refresh the page. Here's the sequence diagram: As you can see, the server query the database twice to display the page to the user. This is inefficient, but how can you improve this? The time between the two requests is very short (about 1 second). So, maybe you can store the object in memory, and reuse it when the user… [read more]