Пример #1
0
        public bool UpsertPhone(Phone phone)
        {
            if (phone is null)
            {
                throw new EntityNotFoundException("User -> Phone");
            }

            var current = Phones.FirstOrDefault(r => r.Type == phone.Type);

            if (current is null)
            {
                Phones.Add(phone);
            }
            else
            {
                current = phone;
            }

            return(true);
        }
Пример #2
0
 public override string ToString()
 {
     return($"{Address}, {Phones.FirstOrDefault()}, ${Price}, R:{Rooms}, {Uri}");
 }
Пример #3
0
 public string GetPhone() => Phones?.FirstOrDefault()?.Formatted;