/// <summary> /// Specify domain events to be applied when transitioning to the new state. /// </summary> /// <param name="events"></param> /// <returns></returns> public State <TS, TD, TE> Applying(ILinearSeq <TE> events) { if (DomainEvents == null) { return(Copy(null, null, null, events)); } return(Copy(null, null, null, new ArrayLinearSeq <TE>(DomainEvents.Concat(events).ToArray()))); }
/// <summary> /// Specify domain event to be applied when transitioning to the new state. /// </summary> /// <param name="e"></param> /// <returns></returns> public State <TS, TD, TE> Applying(TE e) { if (DomainEvents == null) { return(Copy(null, null, null, new ArrayLinearSeq <TE>(new[] { e }))); } var events = new List <TE>(); events.AddRange(DomainEvents); events.Add(e); return(Copy(null, null, null, new ArrayLinearSeq <TE>(DomainEvents.Concat(events).ToArray()))); }