private void btnDelete_Click(object sender, RoutedEventArgs e) { tbName.Text = ""; tbSurname.Text = ""; cbGroup.Text = ""; int stId = (dgStudent.Items[dgStudent.SelectedIndex] as StudentsDTO).Id; foreach (var item in Students) { if (item.Id == stId) { service.DeleteStudent(item); break; } } Update(service); }
public IActionResult RemoveStudent(int id) { return(Ok(_service.DeleteStudent(id))); }