public GroupAccount(Account account, Group group, GroupAccountType type) { Account = account ?? throw new ArgumentNullException(nameof(account)); Group = group ?? throw new ArgumentNullException(nameof(group)); Type = type ?? throw new ArgumentNullException(nameof(type)); AccountId = account.Id; GroupId = group.Id; TypeId = type.Id; }
private void AddAccount(Account account, GroupAccountType type) { _ = account ?? throw new ArgumentNullException(nameof(account)); if (GroupAccounts.All(x => x.Account != account)) { var groupAccount = new GroupAccount(account, this, type); GroupAccounts.Add(groupAccount); account.GroupAccounts.Add(groupAccount); } }