public ActionResult <CommonResponeModel> Delete(long Id)
        {
            int result = trainingCourseRepository.Delete(Id);

            if (result > 0)
            {
                Result = new SuccessResultFactory().Factory(ActionType.Delete);
            }
            else
            {
                Result = new ErrorResultFactory().Factory(ActionType.Delete);
            }

            return(GetCommonRespone());
        }
        public IActionResult DeleteCourse([FromQuery] int courseId)
        {
            var lang          = Request.Headers["language"].ToString();
            var errorMessages = new List <string>();

            try
            {
                var course = _trainingCourseRepository.FindById(courseId);
                if (course == null)
                {
                    return(NotFound());
                }

                var deletedCourse = _trainingCourseRepository.Delete(courseId);

                return(Ok(new { deletedCourseId = deletedCourse.Id }));
            }
            catch
            {
                errorMessages.Add(_translator.GetTranslation("ERROR", lang));
                return(BadRequest(new { errors = errorMessages }));
            }
        }