Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# DateTime to UNIX timestamps
- C# Use HttpClient to GET JSON from API endpoint
- C# JWT Token Get Expiry Timestamp
- Serialization and deserialization of 'System.IntPtr' instances are not supported. Path: $.TargetSite.MethodHandle.Value
- .NET API CORS: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header.NET API
- C# Authorization in .NET Core API's using Attributes, TypeFilterAttribute and IAuthorizationFilter
- Create C# Class from SQL
Archive
Meta
Tag Archives: Newtonsoft
C# Newtonsoft camelCasing the serialized JSON output
JSON love to be camelCased, while the C# Model class hates it. This comes down to coding style, which is – among developers – taken more seriously than politics and religion. But fear not, with Newtonsoft (or is it newtonSoft … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged CamelCasePropertyNamesContractResolver, Deserialization, JSON, JsonProperty, Newtonsoft, Serialization
Leave a comment
C# HttpClient POST or PUT Json with content type application/json
The HttpClient is a nifty tool for getting and sending data to a URL, but it works differently from the old fashioned WebRequest class. The content type is added to the post data instead of added as a header parameter. … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged HttpClient, JSON, Newtonsoft, StringContent
4 Comments
C# Newtonsoft serialize property that is an array and a string
IdentityServer4 has a strange way of returning roles. If there is only one role, the property is a string: But if there is more than one role, the property is an array of strings: If the property is a string, … Continue reading
Azure CloudQueue, Get and Set Json using Newtonsoft.Json and Microsoft.WindowsAzure.Storage
The Microsoft Azure Cloud have a nice simple Queue mechanism in their Azure Storage where you can store up to 64 kb of data for up to 7 days. The queue is very easy to set up and very easy … Continue reading