public ApiError(AppException ex, bool showDetails) { ErrorCode = (int)ex.ErrorCode; Message = ex.Message; Details = showDetails ? ex.ToString() : ""; }