Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 public void Fails(Constants.Error errorCode, Exception error = null)
 {
     this.ErrorCode = errorCode;
     this.Error     = error;
 }
Ejemplo n.º 4
0
 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;
 }