نمونه کد حذف اطلاعات
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("SiteAddress");
var id = txtId.Text.Trim();
var url = "api/employee/" + id;
HttpResponseMessage response = client.DeleteAsync(url).Result;
if (response.IsSuccessStatusCode)
{
MessageBox.Show("User Deleted");
BindEmployeeList();
}
else
{
MessageBox.Show("Error Code" + response.StatusCode + " : Message - " + response.ReasonPhrase);
}