I been working on this API that I would like to remove the top element but I am not sure the best way to do it. Do I need to
public CARlinesResponse GetCarslinesResponse (string accessKey)
CARlinesResponse CAR = new CARlinesResponse();
CarlineManager cm = new CarlineManager ();
CarslineReportParameters cr= new CarslineReportParameters ();
car.lines = GetGuidelineViewModel(cm.GetCarslinesResponse (cr));
return CAR;
//return CAR.CARline;
}
Model
namespace WebApi.Models
{
public class CARlinesResponse
{
public CARline[] CARlines{ get; set; }
}
Output I am looking for
[
{
"Id": "9c996a94-5a61-42b4-953e-34134f6332b3",
"Title": "Jeep",
"Version": "grand cherokee",
}
]
Like to remove the top level cars
{
"CARline": [
{
"Id": "9c996a94-5a61-42b4-953e-34134f6332b3",
"Title": "Jeep",
"Version": "grand cherokee"
}
return Car.Carline;- you'd also have to modify your method signature accordingly. Is there a problem when you do that?