skip to Main Content

JsonSerializer.Deserialize always returns Null

Trying to deserialize the following json string: string json = "{"d":{"__metadata":{"id":"http://my.dev.int:8000/sap/opu/odata/sap/ZFIORI_SERIAL_NUMBERS_SRV/MATERIALSet('250')","uri":"http://my.dev.int:8000/sap/opu/odata/sap/ZFIORI_SERIAL_NUMBERS_SRV/MATERIALSet('250')","type":"ZFIORI_SERIAL_NUMBERS_SRV.MATERIAL"},"MATNR":"250","MAKTX":"X:K10/MF250"}}"; into Class Object namespace Scanner.Model { public class Material { public string MATNR { get; set; } public string MAKTX { get; set; } } } I have tried…

VIEW QUESTION

Using a Custom Enum Json Converter

I am looking to create a custom JSON converter on my C# application. When I instantiate a new class I am unable to leave it generic. Class: using System.Text.Json; using System.Text.Json.Serialization; public class Converter<T> : JsonConverter<T> where T : Enum…

VIEW QUESTION

ImageResizer – Getting generic error GDI while resizing image – Asp.net

Here is my Image resizing code. private void ResizeImage(int width, int height, string szFilePath, string destinationPath) { //var watch = new System.Diagnostics.Stopwatch(); //watch.Start(); Serilog.Log.ForContext<ImageResizeHandler>().Information($"Image resize process start for file :{szFilePath}"); var instructions = getInstructions(width, height); try { ImageResizer.ImageBuilder.Current.Build(szFilePath, szFilePath, instructions);…

VIEW QUESTION
Back To Top
Search