コード例 #1
0
        public async Task <ActionResult> Delete(int id)
        {
            var projeto = await _prjRepo.GetbyId(id);

            if (projeto == null)
            {
                NotifierError("Não foi encontrado projeto com o Id informado!");
                return(CustomResponse());
            }

            await _prjService.Delete(id);

            return(CustomResponse());
        }
コード例 #2
0
        public async Task<ActionResult> Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            try
            {
                return Ok(await _servicoprojetos.Delete(id));
            }
            catch (ArgumentException ex)
            {
                return StatusCode((int)HttpStatusCode.InternalServerError, ex.Message);
            }

        }