public void AddBcc(Account account) { _ = account ?? throw new ArgumentNullException(nameof(account)); if (!MessagePersons.Any(x => x.Type == MessagePersonType.Bcc && x.Account == account)) { MessagePersons.Add(new MessagePerson(account, this, MessagePersonType.Bcc)); } }
public void SetSender(Account sender) { _ = sender ?? throw new ArgumentNullException(nameof(sender)); var actualReceiver = MessagePersons.FirstOrDefault(x => x.Type == MessagePersonType.Sender); if (actualReceiver != null) { MessagePersons.Remove(actualReceiver); } MessagePersons.Add(new MessagePerson(sender, this, MessagePersonType.Sender)); }