this code checks if the list of contractors contains email addresses. then in the else statement there is a possibility that the email address will still become 0. I need a piece of code that populates the list of email addresses when it is zero.
if (counterParty == null)
{
mailAddressesOfCounterparty = new List<Email>();
Email unKnownEmail = new Email();
unKnownEmail.EmailAddress = loopPayment.ShortNameCalypso + "@NotInCounterpartyTable.nl";
mailAddressesOfCounterparty.Add(unKnownEmail);
}
else
{
mailAddressesOfCounterparty =
emailAddress.Where(ea => ea.CounterPartyId == counterParty.Id && ea.IsOptionContract == startOfGroupPayment.OptionContract).ToList();
}
this code should make an email address. just don’t know how to check for zero.
Email unKnownEmail = new Email();
unKnownEmail.EmailAddress = loopPayment.ShortNameCalypso + "@NotInCounterpartyTable.nl";
mailAddressesOfCounterparty.Add(unKnownEmail);
in else I need to add the ability to change the email address to something when it becomes zero. the code will not give me an if statement.
mailAddressesOfCounterparty becomes null because it has not yet been added to the database. But this information may also be missing when using this application. In this case, I want to create an email address that shows that it cannot be found.