Example #1
0
        /// <summary>
        /// Create a new Group Association based on the GroupAssociation data.
        /// </summary>
        /// <param name="groupAssociationDataRepository">Group association repository.</param>
        /// <param name="draftGroupAssociationData">Group Association data received from the web interface.</param>
        /// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
        public static async Task CreateGroupAssociation(
            this IGroupAssociationDataRepository groupAssociationDataRepository,
            GroupAssociationData draftGroupAssociationData)
        {
            var tmpGroupAssociation = new GroupAssociationDataEntity
            {
                PartitionKey = GroupAssociationTableNames.GroupDataPartition,
                RowKey       = draftGroupAssociationData.GroupId,
                ChannelId    = draftGroupAssociationData.ChannelId,
                GroupName    = draftGroupAssociationData.GroupName,
                GroupId      = draftGroupAssociationData.GroupId,
                Email        = draftGroupAssociationData.GroupEmail,
            };

            await groupAssociationDataRepository.CreateOrUpdateAsync(tmpGroupAssociation);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupAssociationController"/> class.
 /// </summary>
 /// <param name="groupAssociationDataRepository">Instance of the group association repository.</param>
 public GroupAssociationController(IGroupAssociationDataRepository groupAssociationDataRepository)
 {
     this.groupAssociationDataRepository = groupAssociationDataRepository ?? throw new ArgumentNullException(nameof(groupAssociationDataRepository));
 }