public IAccount GetDefaultAccount() { if (defaultAccount == null || accounts1.ContainsKey(defaultAccount.Id) == false) { defaultAccount = accounts1.First((a) => true); if (defaultAccount != null) { accounts1.ForEach( (other) => { if (other.Id < defaultAccount.Id) { defaultAccount = other; } }); } else { int id = AddAccount(new Account() { DomainName = @"officesip.local", }); defaultAccount = accounts1.GetValue(id); } } return(defaultAccount); }