Angular 5 – download file with authentication

Source: https://www.illucit.com/en/angular/angular-5-httpclient-file-download-with-authentication/ This article describes how a typical browser file download can be triggered using the Angular HttpClient. Typically you can simply introduce a link to the endpoint of the file download into the page and this will work just fine. However, if you use authentication via bearer token etc. and the download endpoint needs authentication, you probably want to use … Read moreAngular 5 – download file with authentication

Understanding c# ConcurrentDictionary

https://app.pluralsight.com/player?course=csharp-concurrent-collections&author=simon-robinson&name=csharp-concurrent-collections-m6&clip=4&mode=live https://www.codeproject.com/Articles/548406/Dictionary-plus-Locking-versus-ConcurrentDictionar https://stackoverflow.com/questions/1949131/net-dictionary-locking-vs-concurrentdictionary A thread-safe collection vs. a non-threadsafe-collection can be looked upon in a different way. Consider a store with no clerk, except at checkout. You have a ton of problems if people don’t act responsibly. For instance, let’s say a customer takes a can from a pyramid-can while a clerk is currently building … Read moreUnderstanding c# ConcurrentDictionary

What is c# where T constraint

I saw some code using where T syntax. Where T is a constraint – https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters. I wrote next (although not very useful example, just for demonstration) example: public interface IBaseModel { string Message { get; set; } } public class ApiResponseMessage : IBaseModel { public string Message { get => throw new NotImplementedException(); set => throw … Read moreWhat is c# where T constraint

Inside the Concurrent Collections: ConcurrentDictionary

Source: https://www.red-gate.com/simple-talk/blogs/inside-the-concurrent-collections-concurrentdictionary/ Using locks to implement a thread-safe collection is rather like using a sledgehammer – unsubtle, easy to understand, and tends to make any other tool redundant. Unlike the previous two collections I looked at, ConcurrentStack and ConcurrentQueue, ConcurrentDictionary uses locks quite heavily. However, it is careful to wield locks only where necessary to ensure that concurrency is maximised. This … Read moreInside the Concurrent Collections: ConcurrentDictionary

The .NET Dictionary

Source: https://www.red-gate.com/simple-talk/blogs/the-net-dictionary/ To many people, System.Collections.Generic.Dictionary<TKey,TValue> is just a useful collection. In this post, I’ll be looking inside that collection and see how it really works. Dictionary is based on a hashtable; for the rest of this post, I’ll assume you know roughly how a hashtable works. The Wikipedia article, as the source of all knowledge algorithmical, provides a good … Read moreThe .NET Dictionary

Inversion of Control

Source: http://joelabrahamsson.com/inversion-of-control-an-introduction-with-examples-in-net/   An introduction to Inversion of Control, using the Dependency Injection and Service Locator patterns, with simple examples in C#. Lately I’ve been giving a couple of presentations on the subject of automated testing of websites. According to myself and the feedback I’ve gotten one of the most important parts of the presentations has been … Read moreInversion of Control