public bool FetchLocked(int id) { Location location = DBHandler.GetLocations().FirstOrDefault(x => x.LocationId.Equals(id)); if (location.Locked) { location.Locked = false; } else { location.Locked = true; } DBHandler.SetLockedLocation(location); Location location2 = DBHandler.GetLocations().FirstOrDefault(x => x.LocationId.Equals(id)); return(location2.Locked); }