public TickerResponse Tick(TickerRequest tickRequest) { return HttpRequestAdapter.WebHttpPostRequest<TickerResponse>(_serviceBaseUrl, "Tick", tickRequest, String.Concat("?apikey=", _apiKey)); }
public TickerResponse Tick(TickerRequest tickRequest) { TickerResponse response = new TickerResponse(); var validationResult = Validation.Validate<TickerRequest>(tickRequest); try { Traveler traveler = _repository.FindBy<Traveler>(t => t.TravelerID == _currentTravelerId); if (validationResult.IsValid) { LocationService locationSvc = new LocationService(_locationDeterminator, _repository, _geoCoder); locationSvc.UpdateTravelerCoordinates(traveler, tickRequest.IPAddress); response.City = traveler.City; response.Country = traveler.Country; response.Latitude = traveler.Latitude; response.Longtitude = traveler.Longtitude; } response.NewMessagesCount = traveler.Messages.Count(m => m.IsRead == false && m.FolderID == (int)FolderType.Inbox); response.MarkSuccess(); } catch (Exception ex) { ReportError(ex, response); } return response; }