public async Task <bool> DeleteLeafAsync(DeleteLeafModel model) { var leaf = await _context.Leaves.SingleOrDefaultAsync(x => x.LeafId == model.LeafId); _context.Leaves.Remove(leaf); await _context.SaveChangesAsync(); return(true); }
public async Task <IActionResult> DeleteLeaf([FromBody] DeleteLeafModel model) { var response = await _leafService.DeleteLeafAsync(model); return(Ok()); }