예제 #1
0
        /// <summary>
        /// Add Reflection data in Table Storage.
        /// </summary>
        /// <param name="taskInfo">taskInfo.</param>
        /// <returns>A task that represents the work queued to execute.</returns>
        public async Task SaveReflectionFeedbackDataAsync(UserfeedbackInfo taskInfo)
        {
            _telemetry.TrackEvent("DeleteReflections");
            try
            {
                FeedbackDataRepository feedbackDataRepository = new FeedbackDataRepository(_configuration, _telemetry);

                if (taskInfo != null)
                {
                    var feedbackID = Guid.NewGuid();
                    var rowKey     = Guid.NewGuid();

                    FeedbackDataEntity feedbackDataEntity = new FeedbackDataEntity
                    {
                        PartitionKey    = PartitionKeyNames.FeedbackDataTable.FeedbackDataPartition,
                        RowKey          = rowKey.ToString(),
                        FeedbackID      = feedbackID,
                        FullName        = taskInfo.userName,
                        ReflectionID    = taskInfo.reflectionId,
                        FeedbackGivenBy = taskInfo.emailId,
                        Feedback        = Convert.ToInt32(taskInfo.feedbackId)
                    };
                    await feedbackDataRepository.InsertOrMergeAsync(feedbackDataEntity);
                }
            }
            catch (Exception ex)
            {
                _telemetry.TrackException(ex);
            }
        }