specially my problem is to assign array uploadedfiles
how to receive this json data
{ "ID": 0, "StationId": 1, "UnitId": 1, "OutageTypeId": 1, "ZoneId": 2, "FinYear": "2018-2019", "PhotoTag": "azxxxcssac", "UploadedFiles": [{
"UploadedFiles": "data:image/jpeg;base64,/9j/4AA/QSkZ***Jggg==",
"UploadedFiles": "data:image/jpeg;base64,/9j/4AA/QSkZ***Jggg==",
"UploadedFiles": "data:image/jpeg;base64,/9j/4AA/QSkZ***Jggg==",
}] }
this is my model class
public class ImageUploadModel
{
public int ID { get; set; }
public int StationId { get; set; }
public int UnitId { get; set; }
public int OutageTypeId { get; set; }
public int ZoneId { get; set; }
public string FinYear { get; set; }
public string PhotoTag { get; set; }
public List Image { get; set; }
}
this is my code to assign all value to model class
public List
Jignesh KumarPosted Jun 23, 2023, 7:15 AM
Hello Sandeep,
Best way to map response to model is Json deserialize, Please do needful as below,
Create classed for your json response,
Add name space to your class,
using Newtonsoft.Json;
Convert your resoponse,
Rajkiran SwainPosted Jun 23, 2023, 6:45 AM
Make sure to include the necessary using directives:
Sandeep KumarPosted Jun 23, 2023, 6:25 AM
again same error
Rajkiran SwainPosted Jun 23, 2023, 6:21 AM
Can you try this code ?
Sandeep KumarPosted Jun 23, 2023, 6:15 AM
therevis is a error showing
attaching screen shot
Rajkiran SwainPosted Jun 23, 2023, 6:03 AM