Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- Create C# Class from SQL
- C# HttpClient POST or PUT Json with content type application/json
- Run tasks in parallel using .NET Core, C# and async coding
- C# get results from Task.WhenAll
- C# Get expiry timestamp from JWT token
- Using C# HttpClient from Sync and Async code
- ASP.Net Core API - "'s' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
Archive
Meta
Category Archives: .net
Create C# Class from SQL
I hate doing plumbing code. Especially entity model classes that are exact replicas of SQL tables. I do this all the time when using Dapper. So I did some googling and found some SQL statements that you can run in … Continue reading
C# Thread Safe File Writer and Reader
Previously I wrote the article Write to file from multiple threads async with C# and .NET Core, which explains how to use a ConcurrentQueue to append lines to a text file. And the ConcurrentQueue is great for the fire-and-forget scenarios of … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged File, Multithreading, Mutex, Semaphore, Thread, Thread Safe
Leave a comment
C# Log to Application Insights and File from your .NET 6 Application
So why would you ever log to Application Insights AND File log at the same time? Well, if you are hosting your own applications on your own machine, it can be great to have a file version of what’s happened. … Continue reading
Posted in .net, .NET Core, c#, General .NET, Microsoft Azure
Tagged Application Insights, Log, Logging, Serilog
2 Comments
Get Users from IdentityServer using .NET Core
If you wish to poke around in the IdentityServer users database directly, the API seems a little bit fishy. This is because the direct data access are very low level, and consists of HttpClient extension methods. They are, in fact, … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged Authentication, Authorization, HttpClient, IdentityServer, IHttpClientFactory, JWT
Leave a comment
Host .net core 6.0 WebApplication as Kestrel Windows Service
If you create a .NET Core 6.0 Web Application as default, the application will run as an App Service just fine. But if you wish to host the application yourself, you can run the application as a Windows Service. This … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged Kestrel, UseWindowsService, WebApplication, Windows Service
Leave a comment
C# .NET Core API Versioning with Microsoft.AspNetCore.Mvc.Versioning
.NET Core allows you to control versions of your APIs. To do so you need the following NuGet package: Microsoft.AspNetCore.Mvc.Versioning But lets try to version our API. STEP 1: CREATE A CONTROLLER Notice how I in line 6 defines the … Continue reading
Read and Update Azure App Configuration settings with C#
Azure App Configuration is a nifty way of storing configuration settings in the cloud, and with the live reload feature you can change the config settings and they will automatically update in your app without a need for redeploy. But … Continue reading
Posted in .net, .NET Core, c#, General .NET, Microsoft Azure
Tagged Azure, Azure App Configuration, Config, Configuration, ConfigurationClient
Leave a comment
.NET 6.0 and Simple (minimal) Api’s: Create an Api without controllers
Have you always dreamt of skipping the controllers in your Web Api? Are you the lazy type? And have you always wanted to return data directly from your repositories? Feat not, .NET 6.0 to your rescue. The new “Minimal Api” … Continue reading