private bool GetIsPackageArrivedFrom(SroEvent @event) { var destination = new Location(); var isDestinationAvailable = GetIsDestinationAvailable(@event); var eventLocationsList = new List <Location>(); var isArrived = false; if (isDestinationAvailable) { destination = SroResponseJsonAdapter.GetForwarededToLocationFrom(@event); } else { destination = SroResponseJsonAdapter.GetLocationFrom(@event); } Json.evento.ForEach(_event => { var eventLocation = SroResponseJsonAdapter.GetLocationFrom(_event); var locationsMatch = LocationEntity.CompareLocationsBool(destination, eventLocation); if (locationsMatch) { isArrived = true; } }); return(isArrived); }
private Location GetForwardedToLocationFrom(SroEvent @event) { var destinationAvailable = GetIsDestinationAvailable(@event); if (destinationAvailable) { return(SroResponseJsonAdapter.GetForwarededToLocationFrom(@event)); } return(SroResponseJsonAdapter.GetLocationFrom(@event)); }