Esempio n. 1
0
        public override async Task <IEnumerable <BaseNotificationInfo> > ProcessInputMessageAndLoadAdditionalInfoForMultipleNotification(CloseItemQueueNotification messageFromQueue)
        {
            var list = new List <CloseJoinInfo>();
            List <ParticipantDto> participants  = null;
            BasicWishGiftDto      wishOrGiftDto = null;

            if (messageFromQueue.TargetType == "wish")
            {
                participants = await _wishRepository.GetAllParticipants(messageFromQueue.ClosedItemId);

                wishOrGiftDto = await _wishRepository.GetBasicInfo(messageFromQueue.ClosedItemId);
            }



            if (messageFromQueue.TargetType == "gift")
            {
                participants = await _giftRepository.GetAllParticipants(messageFromQueue.ClosedItemId);

                wishOrGiftDto = await _giftRepository.GetBasicInfo(messageFromQueue.ClosedItemId);
            }

            var ownerWishOrGift = await _profileRepository.GetTinyProfile(wishOrGiftDto.Owner);

            foreach (var participant in participants)
            {
                list.Add(new CloseJoinInfo()
                {
                    OwnerId = participant.Id, Target = wishOrGiftDto, User = ownerWishOrGift, TargetType = messageFromQueue.TargetType
                });
            }

            return(list);
        }