Пример #1
0
        public async Task <ActionResult <BoardResponse> > DeleteBoard(long id)
        {
            var board = await _boardRepository.Delete(id);

            var boardResponse = MapModelToResponse(board);

            return(boardResponse);
        }
Пример #2
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int Id = Convert.ToInt32(Request.QueryString["Id"]);

            var repository = new BoardRepository();

            repository.Delete(Id);
            Response.Redirect("LIst.aspx");
        }
        public IActionResult DeleteBoardById(int id)
        {
            Board board = (from a in _boardRepository.Get()
                           where a.Id == id
                           select a)
                          .SingleOrDefault();

            if (null != board)
            {
                _boardRepository.Delete(board);
                _boardRepository.Save();
            }
            return(Ok());
        }