ASP.NET Core ModelState Validation Filter

ASP.NET Core ModelState Validation Filter

During my code review sessions I see a lot of duplicate for the ModelState validation like

1public async Task<IActionResult> AddAsync(PersonAddSubmitModel model)
2{
3    if(ModelState.IsValid)
4    {
5        return BadRequest(ModelState);
6    }
7
8    // ......
9}

But it makes no sense to use the same code in every action to validate your submit model. It can be easier!

Read Blog Post
ASP.NET Core - Using TempData

ASP.NET Core - Using TempData

TempData is next to ViewBag and ViewData a common way to handle data for Requests and Views.

ViewData and ViewBag is only available in the current request and current View. TempData has the functionality to store data from one request to another. Keys inside TempData will be removed if you read them once!

Read Blog Post
Disable Windows 10 Game Mode

Disable Windows 10 Game Mode

Sometimes I play games like Rocket League. Not very active, but sometimes.

In the past my playtime was laggy. I thought my graphic card is not powerful enough so I updated from a nVidia 770 to a 1070. But still the same laggy moments while playing games. Money wasted.

Read Blog Post