/// <summary> /// New Result created with the provided information. Could be positive or negative. /// </summary> /// <param name="infoMessage"></param> /// <param name="errorCode">optional</param> /// <param name="isOk">optional</param> /// <param name="error">optional</param> public Result(string infoMessage, Constants.Error errorCode = Constants.Error.ERR_UNSPECIFIC_ERROR, bool isOk = true, Exception error = null) { this.IsOk = isOk; this.Error = error; this.Message = infoMessage; this.ErrorCode = errorCode; }
/// <summary> /// Creates a new negative (failed) Result, with the provided message and the other optional attributes /// </summary> /// <param name="message"></param> /// <param name="errorCode">optional</param> /// <param name="error">optional</param> /// <returns></returns> public static Result Failure(string message, Constants.Error errorCode = Constants.Error.ERR_UNSPECIFIC_ERROR, Exception error = null) { return(new Result(message, errorCode, false, error)); }
public void Fails(Constants.Error errorCode, Exception error = null) { this.ErrorCode = errorCode; this.Error = error; }
public void Fails(string message, Constants.Error errorCode = Constants.Error.ERR_UNSPECIFIC_ERROR, Exception error = null) { this.Message = message; this.ErrorCode = errorCode; this.Error = error; }