Exemple #1
0
        public IActionResult Delete(int id)
        {
            PatientLogic patLogic = new PatientLogic(_unitOfWork);

            try
            {
                int deleted = patLogic.DeleteCascade(id);
                //int deleted = patLogic.Delete(id);
                if (deleted > 0)
                {
                    return(Ok());
                }
                //else if (deleted== -1 )
                //{
                //    return BadRequest("Cascade delete is not allowed");
                //}
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }