/// <summary> /// Creates a skeleton agenda of the specified type. /// </summary> /// <param name="meetingId">Meeting Id.</param> /// <param name="skeletonAgendaType">Type of the skeleton agenda.</param> /// <returns>Skeleton Agenda.</returns> public IAgendaItem Create( Guid meetingId, SkeletonAgendaType skeletonAgendaType) { this.ResetFactory(meetingId); return(skeletonAgendaType switch { SkeletonAgendaType.Empty => this.CreateEmptyAgenda(), SkeletonAgendaType.BasicInitial => this.CreateBasicInitialAgenda(), SkeletonAgendaType.BasicContinuation => this.CreateBasicContinuationAgenda(), _ => throw new NotSupportedException() });
/// <inheritdoc/> public async Task <IAgendaItem> CreateSkeletonAgendaAsync( IWho who, AuditEvent auditEvent, Guid meetingId, SkeletonAgendaType skeletonAgendaType) { this.logger.ReportEntry( who, new { AuditEvent = auditEvent, MeetingId = meetingId, SkeletonAgendaType = skeletonAgendaType }); SkeletonAgendaFactory factory = new SkeletonAgendaFactory(); IAgendaItem agendaItem = factory.Create(meetingId, skeletonAgendaType); try { IAuditHeaderWithAuditDetails auditHeader = this.data.BeginTransaction(auditEvent, who); await this.data.CreateAgendaItemRecursivelyAsync( who, auditHeader, agendaItem).ConfigureAwait(false); await this.data.CommitTransactionAsync(auditHeader) .ConfigureAwait(false); } catch (Exception) { this.data.RollbackTransaction(); throw; } this.logger.ReportExit( who, new { AgendaItem = agendaItem }); return(agendaItem); }