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)); }
public static AggregateResult <TAggregate> Fail(Exception exception) { return(AggregateResult <TAggregate> .Fail(new NotificationList(), exception)); }