示例#1
0
        public async Task <IActionResult> DeleteEmployee(int?empId)
        {
            int result = 0;

            if (empId == null)
            {
                return(BadRequest());
            }

            try
            {
                result = await serviceapi.DeleteEmployee(empId);

                if (result == 0)
                {
                    return(NotFound());
                }
                return(Ok("Employee record deleted successfully. "));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }