public IActionResult Add([FromBody] Training TData) { string message = string.Empty; ResultOutput ROutput = new ResultOutput(); try { TrainingManager TM = new TrainingManager(IAccess, IConfig); ROutput = TM.Add(TData); message = ROutput.Message; if (!ROutput.isSuccess) { return(StatusCode(StatusCodes.Status400BadRequest, new { message = message })); } return(StatusCode(StatusCodes.Status200OK, new { message = message })); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, new { message = ex.Message })); } }