Quantcast
Channel: briancaos – Brian Pedersen's Sitecore and .NET Blog
Browsing latest articles
Browse All 274 View Live

Image may be NSFW.
Clik here to view.

C# Marking Deprecated Code As Obsolete

If a certain piece of code is no longer relevant or needed, or if it’s no longer maintained, you can mark it as obsolete. Use the [Obsolete] tag to mark the code. You can mark a function:...

View Article


Image may be NSFW.
Clik here to view.

C# Add UserAgent to Application Insights Request Telemetry using a Middleware

This is probable rather specific, but I have this API endpoint, and in my Application Insights I need the UserAgent whenever I log a Request. Custom Properties of a Request Telemetry in Application...

View Article


C# Sort List of Dynamic Objects

The dynamic type in C# is a static type that bypasses static type checking. This makes it possible for you to work with objects like they were strongly typed, but without having to create named model...

View Article

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 Article

C# 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 Article


Azure 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 Article

Convert 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 Article

C# 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 Article


Connect 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 Article


Image may be NSFW.
Clik here to view.

Azure 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 Article
Browsing latest articles
Browse All 274 View Live