public IActionResult OnGet(int id) { Location = _locationData.Get(id); if (Location == null) { return(RedirectToAction("Index", "Home")); } return(Page()); }
public IActionResult OnPost(long locationId) { var updatedLocation = locationData.Get(locationId); updatedLocation.TimeEntries.Add(new TimeEntry { Arrival = DateTime.Now }); locationData.Update(locationId, updatedLocation); locationData.Commit(); return(Redirect("./")); }
public IEnumerable <Location> Get() { return(_data.Get()); }