bitScry

  • Home
  • Blog
  • Contact
  • GitHub

C#

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
  • Azure Table Storage Dependency Injection 9th March 2021
  • Inspecting Data in SQL Tables 4th December 2020
  • RestSharp Response Character Encoding 24th September 2020
  • RestSharp AWS S3 Authentication 18th September 2020
  • Grouping Azure Table Storage Entities 17th September 2020
Tag Cloud
.NET .NET Core API appsettings.json ASP.NET Core Authentication Authorization Azure Azure Active Directory Azure AD Azure Function Azure Storage Blob Bootstrap C# Console Application CSS CSV DataTable Dependency Injection Dictionary Enum Extension GZip HTML Image JavaScript jQuery JSON List Middleware MVC MVC 6 Random Serilog SFTP SQL Stored Procedure Stream String Table Table Storage Tag Helper Web Application WordPress
Reading List
  • Build a Wi-Fi Scanner
  • IoT Weather Station
  • User accounts made easy with Azure
  • Install macOS High Sierra in VirtualBox
Programming

RestSharp Response Character Encoding

I’m currently using RestSharp as a client for downloading product details, however it appears that the response from the server (which I have no control over) is encoded in a differerent character set (ISO-8859-1) than RestSharp is expecting (UTF-8). This means that although most characters are converted as expected, some Read more…

By Shinigami, 7 months7 months ago
Programming

RestSharp AWS S3 Authentication

I’ve been needing to access the AWS S3 API recently as part of a project and although there’s a pretty good client already available it didn’t quite meet my needs so I decided I needed to build my own client based on RestSharp. Unfortunatly although the API is pretty simple Read more…

By Shinigami, 7 months7 months ago
Programming

Grouping Azure Table Storage Entities

If you’re using Azure Table Storage then it’s often more efficent to perform operations such as insert, update, delete in batches rather than making seperate calls for each individual row. There can be up to 100 entities in each batch and each all entities in a batch need to have Read more…

By Shinigami, 7 months7 months ago
Programming

Best Practices for Using Azure SDK with ASP.NET Core

Mostly just a link to this article containing best practices. There’s some useful extension methods available from Microsoft.Extensions.Azure to make for easier dependency injection of the various Azure services. There’s also some good examples available here.

By Shinigami, 7 months7 months ago
Programming

JsonResult Serializer Settings in .NET Core3.1

If you are returning a JSON representation of an object from an MVC controller it may be necessary to determine how the JSON is formatted. This can be done using the JsonSerializerSettings object like so. This used to work as is with version 2 of .NET Core but with the Read more…

By Shinigami, 9 months9 months ago
Programming

Check if a Value is Present in Multiple Lists

If you have 2 (or more) lists in C# and you want to check if they have 1 or more values in common then you can use the following LINQ to check.

By Shinigami, 9 months9 months ago
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, 10 months10 months ago
Programming

Getting the Windows User Name in ASP .NET Core

If you want to get a users username in a site that uses authentication then you can just use the User object and that will provide all claims associated with that user. However if you want to get the username for a user where they’re not required to authenticate first Read more…

By Shinigami, 12 months12 months ago
Programming

Using OData with Entity Framework

OData is an open protocol for enabling interaction with a datasource in a standardised way via a RESTful API. Theoretically using OData in combination with Entity Framweork should provide a simple way of providing access to SQL (or other) data via API, this is indeed the case but setting things Read more…

By Shinigami, 1 year9 months ago
Programming

Using OData with Bootstrap Table

Bootstrap Table is the best way I’ve found of adding additional functionality to HTML tables. One of the nice features about it is that it will load data from a URL if it’s provided in the correct JSON format which allows the data provision to be decoupled from the page Read more…

By Shinigami, 1 year1 year ago

Posts navigation

1 2 … 6 Next
Hestia | Developed by ThemeIsle