Exemple #1
0
        public async Task <ActionResult> Delete(TelephoneNote telephoneNote)
        {
            try
            {
                telephoneNote = (await telephoneRepository.GetTelephoneNotes()).FindLast(x => x.Name == telephoneNote.Name);
                await telephoneRepository.RemoveTelephoneNote(telephoneNote);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Exemple #2
0
 public void Delete([FromBody] TelephoneNote telephoneNote)
 {
     telephoneNote = (telephoneRepository.GetTelephoneNotes().GetAwaiter().GetResult()).FindLast(x => x.Name == telephoneNote.Name);
     telephoneRepository.RemoveTelephoneNote(telephoneNote);
 }
 public void Delete(TelephoneNote telephoneNote)
 {
     telephoneRepository.RemoveTelephoneNote(telephoneNote).GetAwaiter().GetResult();
 }