Ejemplo n.º 1
0
        public IHttpActionResult deleteUser([FromUri] int userID)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Not a valid data"));
            }
            try
            {
                TaskManagerRepository tmRep = new TaskManagerRepository();

                if (userID > 0)
                {
                    tmRep.deleteUser(userID);
                    return(Ok());
                }
                else
                {
                    return(BadRequest("Error occurred during data deletion in deleteUser"));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest("Error occurred in deleteUser :" + ex.StackTrace));
            }
        }