ok now spending hours with the following issue.
trying to retrieve the info of 1 single car.
But after Deserializing the response from the API i get NULL.
I know it has something todo with setting up the classes, but i cannot figure out what i'm doing wrong here.
Websites i used to setup the classes.
https://json2csharp.com/
Here is some info:
Data i receive:
<?php
{"data":{"id":"1AF20E","name":"TOMMY28","descriptionShort":"Tommy 28 - A vintage racing car from 1920'","description":"feel the vintage racing with big moustache and reckless drivers\r\ndo not search extrem grip, do not search evil power, but be extremely sharp in your track feeling with this 1928 Tommy racing car.\r\n\r\n2 configs :\r\n- Sport : stricly minimum to race\r\n- Sport Lux : tiny windscreen and lights (very usefull when LFS release the night races)\r\n\r\nMartin18 has work on the 8 inline engine !\r\nFlame CZE give me authorisation for his Hadraplan's steering wheel, clocks and mirrors (modified)\r\nNene87 help me on editor and blender at the beginning\r\n\r\nClocks are old but it works.\r\nsee the motor behind events ;)\r\nlook at the hand-polishing chromes !\r\n2 versions\r\n\r\nantiroll bar are finally added to maintain fun to drive (it was very slippery without)\r\n\r\n- skins with racing numbers and vintage look\r\n- suspensions 3d anim on the rear\r\n- lean driver animation","userId":79595,"userName":"Tomfuel","wip":true,"publishedAt":1640879379,"numDownloads":3803,"curUsage":0,"rating":4.34,"numRatings":43,"staffPick":false,"tweakMod":false,"version":5,"lastDownloadedAt":1640881808,"class":2,"ev":false,"coverUrl":"https:\/\/www.lfs.net\/attachment\/276798","screenshotUrls":["https:\/\/www.lfs.net\/attachment\/274160","https:\/\/www.lfs.net\/attachment\/274161","https:\/\/www.lfs.net\/attachment\/274162","https:\/\/www.lfs.net\/attachment\/274163","https:\/\/www.lfs.net\/attachment\/274164","https:\/\/www.lfs.net\/attachment\/274165","https:\/\/www.lfs.net\/attachment\/274166","https:\/\/www.lfs.net\/attachment\/274167"],"vehicle":{"iceCc":5237,"iceNumCylinders":8,"iceLayout":0,"evRedLine":0,"drive":1,"shiftType":1,"power":81.76211547851562,"maxPowerRpm":3586,"torque":233.3720703125,"maxTorqueRpm":1687,"mass":889.9309692382812,"bhp":109.66752549133301,"powerWeightRatio":91.87467152480184,"bhpTon":125.20896003186276,"fuelTankSize":39.000003814697266}}}
?>
The Classes i've set up
public class GetCarInfo
{
public ModCarEntry CarInfo { get; set; }
}
public class ModCarEntry
{
public string id { get; set; }
public string name { get; set; }
public string descriptionShort { get; set; }
public string description { get; set; }
public int userId { get; set; }
public string userName { get; set; }
public bool wip { get; set; }
public int publishedAt { get; set; }
public int numDownloads { get; set; }
public int curUsage { get; set; }
public double rating { get; set; }
public int numRatings { get; set; }
public int version { get; set; }
public int lastDownloadedAt { get; set; }
public int _class { get; set; }
public bool ev { get; set; }
public string coverUrl { get; set; }
public List<string> screenshotUrls { get; set; }
public CarDetails details { get; set; }
}
public class CarDetails
{
public int iceCc { get; set; }
public int iceNumCylinders { get; set; }
public int iceLayout { get; set; }
public int evRedLine { get; set; }
public int drive { get; set; }
public int shiftType { get; set; }
public double power { get; set; }
public int maxPowerRpm { get; set; }
public double torque { get; set; }
public int maxTorqueRpm { get; set; }
public double mass { get; set; }
public double bhp { get; set; }
public double powerWeightRatio { get; set; }
public double bhpTon { get; set; }
public double fuelTankSize { get; set; }
}