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));
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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));
 }
Example #7
0
 public IActionResult DeleteContact([FromRoute] long id)
 {
     mContactService.DeleteContact(id);
     return(Ok()); //Todo return validation result
 }
Example #8
0
 public IHttpActionResult Delete(string guid)
 {
     _contactService.DeleteContact(guid);
     return(Ok());
 }