Пример #1
0
        private async Task <Ride> GetCurrentRide()
        {
            var lastPings = await pingRepository.GetLastPings(true, 50);

            foreach (var ping in lastPings)
            {
                if ((ping.Time - lastPings[0].Time).TotalMinutes > 5)
                {
                    break;
                }

                if (ping.LocationId != null)
                {
                    break;
                }

                if (ping.RideId != null)
                {
                    return(ping.Ride);
                }
            }

            return(null);
        }