Пример #1
0
        /// <summary>
        /// Remove reflection id based in messageid
        /// </summary>
        /// <param name="reflectionMessageId">reflectionMessageId</param>
        /// <returns>messageid.</returns>
        public async Task <string> RemoveReflectionId(string reflectionMessageId)
        {
            string messageId = null;

            try
            {
                _telemetry.TrackEvent("RemoveMessageId");
                ReflectionDataRepository reflectionDataRepository = new ReflectionDataRepository(_configuration, _telemetry);
                FeedbackDataRepository   feedbackDataRepository   = new FeedbackDataRepository(_configuration, _telemetry);
                var reflection = await reflectionDataRepository.GetReflectionData(reflectionMessageId);

                messageId = reflection.MessageID;
                var feedbackCount = await feedbackDataRepository.GetFeedbackonRefId(reflection.ReflectionID);

                await feedbackDataRepository.DeleteAsync(feedbackCount);

                await reflectionDataRepository.DeleteAsync(reflection);
            }

            catch (Exception ex)
            {
                _telemetry.TrackException(ex);
            }

            return(messageId);
        }
Пример #2
0
        /// <summary>
        /// Delete recurrence data based on the reflection id
        /// </summary>
        /// <param name="reflectionId">reflectionId.</param>
        /// <returns>Null.</returns>
        public async Task DeleteRecurrsionDataAsync(Guid reflectionId)
        {
            try
            {
                _telemetry.TrackEvent("DeleteRecurrsionDataAsync");
                ReflectionDataRepository reflectionDataRepository = new ReflectionDataRepository(_configuration, _telemetry);
                RecurssionDataRepository recurssionDataRepository = new RecurssionDataRepository(_configuration, _telemetry);
                var reflection = await reflectionDataRepository.GetReflectionData(reflectionId);

                var recurssion = await recurssionDataRepository.GetRecurssionData(reflection.RecurrsionID);

                await recurssionDataRepository.DeleteAsync(recurssion);

                await reflectionDataRepository.DeleteAsync(reflection);
            }
            catch (Exception ex)
            {
                _telemetry.TrackException(ex);
            }
        }