public Summary GetSummary(string HotelId) { Summary Response = new Summary(); int id = 0; if (int.TryParse(HotelId, out id)) { Response = new Summary(id); Response.IsSuccess = true; } else { Response.IsSuccess = false; Response.ErrorMessage = "Hotel id must be a valid integer"; } return Response; }
public List<Summary> GetSummaries(string[] HotelIds) { List<Summary> Response = new List<Summary>(); foreach (string hotelid in HotelIds) { Summary summary = new Summary(); int id = 0; if (int.TryParse(hotelid, out id)) { summary = new Summary(id); summary.IsSuccess = true; } else { summary.IsSuccess = false; summary.ErrorMessage = "Hotel id must be a valid integer"; } Response.Add(summary); } return Response; }