public IActionResult Delete(int id)
 {
     try
     {
         return(Ok(keepService.DeleteNote(id)));
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
Example #2
0
        public async Task <IActionResult> Delete([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            //var mongodbService = new KeepService("NotesDatabase", "Notes", "mongodb://127.0.0.1:27017");
            var note = await _context.DeleteNote(id);


            return(Ok(note));
        }