Skip to main content

How to Set Different Log Levels per Environment in appsettings.json

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

On your machine you want to see every SQL statement. In Production you don't: it's noise, and it costs money to store. ASP.NET Core reads appsettings.json, then the file for the current environment on top of it, so one setting in each gives you both. This guide does that for EF Core's SQL log, and checks it in both environments.

How to Bind Query String Parameters with AsParameters in a Minimal API

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A list endpoint collects options: a search term, a category, a sort, a page. Six parameters on one method is hard to read, and passing them along is worse. [AsParameters] puts them in one record, filled from the query string as if each property were its own parameter. This guide uses it on a real product list, with the one detail ASP.NET Core 10 needs.