Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OperationResult&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="data">The data.</param>
 /// <param name="resultType">Type of the result.</param>
 /// <param name="message">The message.</param>
 /// <param name="stackTrace">The stack trace.</param>
 private OperationResult(T data, OperationResultType resultType, string message, string stackTrace, CustomValidationResult customValidationResult)
 {
     this.Data                   = data;
     this.ResultType             = resultType;
     this.Message                = message;
     this.StackTrace             = stackTrace;
     this.customValidationResult = customValidationResult;
 }
Пример #2
0
 /// <summary>
 /// Creates the failure result.
 /// </summary>
 /// <param name="errorCode">The validation error code.</param>
 /// <returns></returns>
 //[SuppressMessage(SuppressMessageConstants.DesignCategory, SuppressMessageConstants.DoNotDeclareStaticMembersOnGenericTypes)]
 public static OperationResult <T> CreateFailureResult(CustomValidationResult validationResult)
 {
     return(new OperationResult <T>(default(T), OperationResultType.Failure, string.Empty, string.Empty, validationResult));
 }