Beispiel #1
0
 public static AggregateResult <TAggregate> AsResult <TAggregate>(this AggregateAndNotifications <TAggregate> info)
     where TAggregate : IAggregateRoot
 {
     return(info.Notifications.HasNotifications
         ? AggregateResult <TAggregate> .Fail(info.Notifications)
         : AggregateResult <TAggregate> .Success(info.Aggregate));
 }
Beispiel #2
0
 public static AggregateResult <TAggregate> Fail(Exception exception)
 {
     return(AggregateResult <TAggregate> .Fail(new NotificationList(), exception));
 }
 public static NotificationList AddNotificationsTo <TAggregate>(
     this AggregateResult <TAggregate> sourceResult, NotificationList targetList)
     where TAggregate : IAggregateRoot
 {
     return(targetList.AddNotifications(sourceResult.Notifications));
 }