예제 #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;