public void Execute(DoWorkEventArgs ea) { var args = (BackgroundWorkerArgs)ea.Argument; ITransportService service = args.TransportService; IEnumerable <Station> locations = service.GetLocations(args.StationQuery); ea.Result = locations; }