Exemplo n.º 1
0
        public async Task <IActionResult> DeleteNote([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            List <Note> note = _businessLogic.DeleteNote(id);

            if (note == null)
            {
                return(NotFound());
            }
            _context.Note.RemoveRange(note);
            _context.CheckList.RemoveRange();
            await _context.SaveChangesAsync();

            return(Ok(note));
        }