public IActionResult DeleteSpeaker(string id)
 {
     if (_speakerRepository.Remove(new ObjectId(id)))
     {
         return(new HttpStatusCodeResult(204)); // 204 No Content
     }
     else
     {
         return(HttpNotFound());
     }
 }
Esempio n. 2
0
        public async Task <bool> DeleteById(long id)
        {
            var speaker = await GetById(id);

            if (speaker == null)
            {
                return(false);
            }
            await _speakerRepository.Remove(speaker);

            await _speakerRepository.Commit();

            return(true);
        }