Код: Выделить всё
DataQueryResult _agreements = new DataQueryResult();
Dictionary _contacts = new Dictionary();
_agreements = this.agreementRepository.GetAgreementsByQuery(_parameters);
Agreement _agreement = _agreements?.Data?.FirstOrDefault();
if (_agreement.AgreementActive)
{
// add contactids for the agreemenet
var _agreementContacts = await this.contactRepository.GetAgreementContactsAsync(_agreement.AgreementId.Value, null);
foreach (var _contact in _agreementContacts.Data)
{
if (_contact.Role.RoleId == DCCommonConstants.RoleId.KeyPersonnel &&
_contact.PersonActive &&
!_contacts.ContainsKey(_contact.ContactId.Value))
{
_contacts.Add(_contact.ContactId.Value, _contact);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... t-using-th
Мобильная версия