It’s been six months since my last article, my freelance career is asking a lot of effort. Source: medium.com/@M3rken/asp-net-core-supporting-multiple-authorization-route-branching-cad3ab632410
Category: programming
ASP.NET Core RESTful Web API versioning made easy
Scott Hanselman on Programming, The Web, Open Source, .NET, The Cloud and More Source: www.hanselman.com/blog/ASPNETCoreRESTfulWebAPIVersioningMadeEasy.aspx
Linq To CSV
LinqToCSV Class namespace FooFoo { public static class LinqToCSV { public static string ToCsv<T>(this IEnumerable<T> items) where T : class { var csvBuilder = new StringBuilder(); var properties = typeof(T).GetProperties(); foreach (T item in items) { string line = string.Join(“,”,properties.Select(p => p.GetValue(item, null).ToCsvValue()).ToArray()); csvBuilder.AppendLine(line); } return csvBuilder.ToString(); } private static string ToCsvValue<T>(this T item) { if(item == null) […]
The Mediator Pattern In .NET Core
A couple of years back, I had to help out on a project that was built entirely using the “Mediator Pattern”. Or more specifically, built entirely using the MediatR library. There were all these presentations about the “theory” behind the Mediator Pattern and how it was a real new way of thinking. I couldn’t help but think… We’ve been doing […]
C# RSS generator in less than than 50 lines of code
What kind of technical blog doesn’t have RSS feed? Well, this one didn’t have one. This short post will present single method for generating RSS feed we are using, and answer why we are not using existing solution. After googling for existing solutions for generating RSS feed, one of the first solution was to use Wildermuth’s RssSyndication library. After trying […]
Asynchronous models and patterns
An introduction to async / await, popular mistakes and solutions for asynchronous programming, as well as usages and benefits from using asynchronous programming. We will also discuss interesting patterns based on concurrency. Source: www.codeproject.com/Articles/562021/Asynchronous-models-and-patterns
Why should I inject IHttpContextAccessor as a Singleton
According to comments associated with an issue raised on GitHub https://github.com/aspnet/Hosting/issues/793#issuecomment-224828588 In that sample, you are registering it as a singleton. Shouldn’t it be a scoped instance? It’s fine being a singleton because the backing store is async local. Which got a later reply https://github.com/aspnet/Hosting/issues/793#issuecomment-224924030 Actually if you register it as a Transient on .NET Core then it […]
Series: Writing High-Performance C# and .NET Code
I am interested in reading this series on this link This series explores modern C# and .NET/.NET Core techniques and features which support writing more performance, low allocation code. Posts in this series: Part 1: Motivations for Writing High-Performance C# Code Part 2: Introduction to Benchmarking C# Code with Benchmark .NET Part 3: An Introduction to Optimising Code […]