public IActionResult OnPost()
        {
            Location l = _locations.GetLocation(LocationId);

            try
            {
                _measurements.AddSpeedMeasurement(MockData.RandomSpeed, _locations.GetLocation(LocationId), MockData.RandomImage);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                InvalidPost = e.Message;
                OnGetMeasurement();
                return(Page());
            }

            return(RedirectToPage("Index"));
        }
Ejemplo n.º 2
0
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Location = _locations.GetLocation((int)id);

            return(Page());
        }
 public IActionResult OnGet(int id)
 {
     Location = repo.GetLocation(id);
     return(Page());
 }
 public void OnGet(int id)
 {
     _location = _locationRepo.GetLocation(id);
 }