bitScry

  • Home
  • About
  • Blog
  • Contact

Dictionary

About this site

This is a blog to help me remember some of the coding challenges I’ve faced and hopefully help others out if they’re suffering the same problems.

Recent Posts
  • Killing a Process Locking Port on a Mac
  • Mocking Hangfire BackgroundClient Jobs
  • Running Shinobi CCTV on a Raspberry Pi
  • Visual Studio CoreCLR Error
  • Adding Healthchecks to a .NET Core 6 API
Tag Cloud

.NET Core AAD API ASP.NET Core Authentication Authorization Azure Azure Active Directory Azure Function Azure Storage Blob Bootstrap C# Cloud Storage Console Application CSS DataTable Dependency Injection Dictionary Entity Framework Enum Extension Google GZip HTML IP Address JavaScript jQuery JSON List MVC MVC 6 Newtonsoft RestSharp Serilog SQL SSDT Stored Procedure Stream String Table Table Storage Web App Web Application WordPress

Programming

Merging Dictionaries Together

If you have 2 dictionaries of the same datatype in C# which you want to merge together then you can use the following code. If a key exists in both of the dictionaries then the primary value will overwite the secondary value. In the above example secondaryDictionary will now contain Read more…

By Shinigami, 2 years2 July 2020 ago
Programming

Dictionary Extensions

While trying to add items to a dictionary I discovered that there’s no equivalent of the AddRange which is available for lists. This is for good reason as adding a KeyValuePair to a dictionary requires first checking that the given key doesn’t already exist and so is more computationally expensive Read more…

By Shinigami, 3 years16 April 2019 ago
Programming

Adding Complex Properties of a TableEntity to Azure Table Storage

If you want to insert a row into an Azure Table Storage table the easiest way is to create a new class with the desired fields that inherits from TableEntity perform an insert operation with it using the storage client. This works fine as long as long as the properties Read more…

By Shinigami, 3 years12 April 2019 ago
Programming

Creating FormUrlEncodedContent Variables from Objects

If you want to send some URL encoded content to an API you can use the built in FormUrlEncodedContent to convert an IEnumerable<KeyValuePair<string, string>> to a correctly coded content object. The most basic way to get the required KeyValuePair IEnumerable is to manually create it. As this is quite a Read more…

By Shinigami, 4 years14 December 2018 ago
Programming

Serializing/Deserializing XML Attribute Lists

I’ve gotten so used to working with JSON that I’d almost forgotten what a chore it can be to work with XML. A case in point is the below XML sample that I’m trying to deserialize into a class, essentially I want to capture all the attributes of the “Attribute” Read more…

By Shinigami, 5 years21 November 2017 ago
  • Facebook
  • Twitter
  • Instagram
  • Email
Hestia | Developed by ThemeIsle