Esempio n. 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);
        }
Esempio n. 2
0
 public override string ToString()
 {
     return($"{Address}, {Phones.FirstOrDefault()}, ${Price}, R:{Rooms}, {Uri}");
 }
Esempio n. 3
0
 public string GetPhone() => Phones?.FirstOrDefault()?.Formatted;