[HttpPost] [Route("")] public async Task<HttpResponseMessage> UploadFile(jsonarraydata) { //how to convert the json array data in objects }
Below is the json array I am passing to post request. I want to convert the array in individual objects so that i can store them in the database. <pre>[{ "Name": "sample string 1", "Owner": "abc" } , { "Name": "sample string 2", "Owner": "xyz" }, { "Name": "sample string 3", "Owner": "ags" }, { "Name": "sample string 4", "Owner": "sdas" } ]
public class MyType { public string Name { get; set; } public string Owner { get; set; } }
public async Task<HttpResponseMessage> UploadFile(List<MyType> jsonarraydata ) {
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)