private void BtnDelete_Click(object sender, RoutedEventArgs e) { int selectedId = (VehicleGrid.SelectedItem as CarVM).Id; var responce = CarLogic.Delete(new CarVM { Id = selectedId, }); if (responce.IsCompleted) { VehicleGrid.ItemsSource = CarLogic.List().Object; } }
public async Task <IActionResult> Delete(int carId) { var isSuccess = await CarLogic.Delete(GetToken(), carId); return(Ok(isSuccess)); }
public IActionResult Delete(string id) { logic.Delete(id); return(RedirectToAction(nameof(Dashboard))); }