Exemplo n.º 1
0
        public IActionResult EndRoute()
        {
            var user = UserManager.GetUserAsync(User).GetAwaiter().GetResult();

            try
            {
                var driver = DriverService.GetByUserId(user.Id);
                DriverService.EndCurrentRoute(driver);
                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                Logger.LogDebug("Failed to end route {@Exception}", e);
                Logger.LogError("Failed to end route {Exception}", e.Message);
                return(BadRequest());
            }
        }