public ActionResult Save([FromBody] TDTO dto) { try { var result = ((IValidator)Activator.CreateInstance(typeof(TValidator))).Validate(dto); if (result.IsValid) { var sucess = OperationBase.Save(dto.Adapt <TEntity>()); return(Ok(sucess)); } else { return(BadRequest(result.ToString())); } } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e)); } }