Пример #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));
 }
Пример #2
0
 public static AggregateResult <TAggregate> Fail(Exception exception)
 {
     return(AggregateResult <TAggregate> .Fail(new NotificationList(), exception));
 }