예제 #1
0
        public async Task <InterlocutorsDto> GetByInterlocutorsIdentifiers(int
                                                                           firstParticipantId, int secondParticipantId)
        {
            var data = await _repository.Chat.GetByInterlocutorsIdentifiers(
                firstParticipantId, secondParticipantId, InterlocutorsDto.Selector());

            return(data);
        }
        private InterlocutorsDto GetInterlocutors(Guid groupId, int interlocutorsCount, bool haveConstSentences)
        {
            var interlocutors = new InterlocutorsDto
            {
                Interlocutors = new List <InterlocutorsDto.InterlocutorDto>(),
                GroupId       = groupId
            };

            for (var i = 1; i <= interlocutorsCount; i++)
            {
                interlocutors.Interlocutors.Add(new InterlocutorsDto.InterlocutorDto
                {
                    PhoneNumber = RandomPhoneNumber(i),
                    Parameters  = new Dictionary <string, string>
                    {
                        { "Termin Wizyty", haveConstSentences ? "02.04.2020" : RandomDate() },
                        { "Godzina Wizyty", haveConstSentences ? "13:30" : RandomTime() },
                        { "Numer Rejestracyjny", haveConstSentences ? "STA 00001": RandomRegistrationNumber(i) }
                    }
                });
            }

            return(interlocutors);
        }