C# Sort JArray NewtonSoft.Json
OK, just to burst your bubble: You cannot sort JArray. But if your JArray is just a list of numbers, or letters, you can convert the JArray into a list, sort that, and put it back into your JArray. In...
View ArticleC# Lowercase all JSON attributes in your API responses
When creating an API in C#, you can control how your JSON response should be formatted. The classic way is to us the JsonPropertyName attribute and define the output in a per-field manner: using...
View ArticleAzure Functions: No job functions found. Try making your job classes and...
This error message might occur when working with Azure Functions in Isolated Mode: No job functions found. Try making your job classes and methods public. If you’re using binding extensions (e.g....
View ArticleConvert JSON Arrays into batches of JSON Arrays using the LINQ Chunk method
This is one way of converting a JSON array of any JSON objects into batches. This function uses the LINQ Chunk method to convert a 1 dimensional array input into a 2 dimensional array output: Example...
View ArticleC# POST x-www-form-urlencoded using HttpClient
To POST x-www-form-urlencoded data in C# using the HttpClient, you can do the following: using System.Net.Http; private static HttpClient _httpClient = new HttpClient(); public async...
View ArticleConnect to Salesforce Data Cloud Ingestion API using C# and HttpClient
As a C# developer, to properly connect to Salesforce Data Cloud, you need to do 3 steps: Request an Access Token using the credentials provided for you. Exchange the Access Token for a Data Cloud...
View ArticleAzure Table Storage Create Read Update Delete entities – a base class...
Azure Table Storage is a simple way of storing structured data with no relations (also known as structured NoSQL data) in a storage account. Think of it as an spreadsheet with 2 mandatory keys (a...
View ArticleC# Serialize HttpRequest to Model Class in Azure Functions
The signature of Http triggered Azure Functions include a HttpRequest: [Function("MyFunction")] public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post")]...
View ArticleC# Use Microsoft Entra ID JWT token as Authentication in .net API
You can use Microsoft Entra ID to create a client secret that allows an application to access your API using a bearer token. STEP 1: SETUP A CLIENT SECRET IN MICROSOFT ENTRA In Microsoft Entra, take a...
View ArticleC# CosmosDB spatial geographic search using GeoJSON coordinates
If you have data in an Azure CosmosDB, it is possible to perform spatial location based searches, returning documents within a distance from a point, or within a certain area. The first thing you...
View Article