I am a c# guy and working with an api where all examples are in php so i need help so i can understand what is this code exactly
$rooms = array();
// First Room
$rooms[] = array(array("paxType" => "Adult"));
// Second Room
$rooms[] = array(array("paxType" => "Adult"), array("paxType" => "Adult"), array("paxType" => "Child", "age" => 8));
I need if anybody can describe this code to me as i am c# guy.
As i am google around this so this is a multidimensional array that i already understand
and pax is class in this api (as per api documentation) which have some properties like paxtype,age etc.....
but i am not getting the way to right this in c#.
Edit
that pax type multidimensional array passed to this method
public getAvailableHotelResponse getAvailableHotel(string apiKey, string destinationId, DateTime checkIn, DateTime checkOut, string currency, string clientNationality, bool onRequest, pax[][] rooms, filter[] filters);
2nd EDIT
public getAvailableHotelResponse getAvailableHotel(string apiKey, string destinationId, DateTime checkIn, DateTime checkOut, string currency, string clientNationality, bool onRequest, pax[][] rooms, filter[] filters);
I have to pass this pax[][] rooms in my method and rooms will have the following structure
rooms[0][0][paxType]=Adult
rooms[0][1][paxType]=Adult
rooms[0][2][paxType]=Child
rooms[0][2][age]=6
rooms[1][0][paxType]=Adult
rooms[1][1][paxType]=Adult
rooms[1][2][paxType]=Child
rooms[1][2][age]=8
and the pax class is below
public class pax
{
public pax();
[SoapElement(DataType = "integer")]
public string age { get; set; }
public string firstName { get; set; }
public string lastName { get; set; }
public string paxType { get; set; }
public string title { get; set; }
}
I think its now much clearer to us all.