public IActionResult DeleteContact(int id) { _service = new ContactsService(); _service.DeleteContact(id); return(RedirectToAction("Index")); }
public HttpResponseMessage DeleteContact(int id) { SuccessResponse response = new SuccessResponse(); ContactsService.DeleteContact(id); return(Request.CreateResponse(response)); }
private async void OnDeleteClicked(object sender, EventArgs e) { var contact = (sender as MenuItem).CommandParameter as Contact; if (await DisplayAlert("Delete contact", string.Format("Are you sure you want to delete {0} {1} from your contacts?", contact.FirstName, contact.Surname), "Yes", "No")) { _contactsService.DeleteContact(contact); _contacts.Remove(contact); } }
public async Task <IActionResult> DeleteContact([FromRoute(Name = "id")] Guid friendId) { try { var myId = ExtractIdFromToken(Request.Headers[HttpRequestHeader.Authorization.ToString()]); await service.DeleteContact(myId, friendId); return(NoContent()); } catch (HttpResponseException) { throw; } catch (Exception) { throw new BadRequestApiException(); } }
public IHttpActionResult Delete([FromUri] string FirstName) { var contacts = contactsService.DeleteContact(FirstName); return(Ok()); }
public IHttpActionResult DeleteContactsTable(Guid guid) { _contactsService.DeleteContact(guid); return(Ok(guid)); }
public IActionResult DeleteContact([FromRoute] long id) { mContactService.DeleteContact(id); return(Ok()); //Todo return validation result }
public IHttpActionResult Delete(string guid) { _contactService.DeleteContact(guid); return(Ok()); }