private static void UpdateLocation(ExpectedLocation location, ApiResponse response) { if (response.Payload != null) { location.Id = ((LocationData)response.Payload).id; } }
private static string CreateNewCoachSaveCommand(ExpectedLocation expectedLocation) { var command = new ApiLocationSaveCommand { name = expectedLocation.Name }; return(JsonSerialiser.Serialise(command)); }
public static void RegisterLocation(ExpectedLocation location, ExpectedBusiness business) { var json = CreateNewCoachSaveCommand(location); var response = PostLocation(business, json); if (response.StatusCode == HttpStatusCode.OK) { UpdateLocation(location, response); } }