Beispiel #1
0
        /// <summary>
        /// Creates a Success NotificationResult
        /// </summary>
        /// <param name="notificatorContext">the instance of the notificator context</param>
        /// <returns>An instance of notification result</returns>
        public static NotificationResult Success(NotificatorContext notificatorContext)
        {
            var result = new NotificationResult(notificatorContext);

            result.Result = Result.Success;
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a Fail NotificationResult
        /// </summary>
        /// <param name="notificatorContext">the instance of the notificator context</param>
        /// <param name="exceptions">the exceptions occurred on the operation</param>
        /// <returns>An instance of notification result</returns>
        public static NotificationResult Fail(NotificatorContext notificatorContext, params Exception[] exceptions)
        {
            var result = new NotificationResult(notificatorContext);

            result.Result     = Result.Fail;
            result.Exceptions = exceptions;
            return(result);
        }
Beispiel #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="notificatorContext">the instance of the notification context</param>
 public NotificationResult(NotificatorContext notificatorContext)
 {
     this.notificatorContext = notificatorContext;
     NotificationId          = notificatorContext.Message.Id;
     NotificationType        = notificatorContext.Message.GetType().AssemblyQualifiedName;
 }