protected void HandleSystemException(Exception ex, IServiceResponse response) { if (response != null) { response.Message = ex.Message; response.AddError(description: ex.ToString(), status: StatusCode.InternalServerError); } Logger.LogException(ex); }
protected bool IsParameterValid(Func <bool> validation, string parameterName, IServiceResponse response) { if (validation()) { return(true); } response.AddError( description: string.Format(MissingParameterMessage, parameterName), status: StatusCode.BadRequest); Logger.LogError(response); return(false); }