Пример #1
0
 private static void UpdatePhone(Housing item, int order, string phone)
 {
     var housingPhone = item.Phones.SingleOrDefault(x => x.Order == order);
     if (housingPhone != null)
     {
         housingPhone.Number = phone;
     }
     else if(!string.IsNullOrEmpty(phone))
     {
         housingPhone = new HousingPhone { Number = phone, Order = order };
         item.Phones.Add(housingPhone);
     }
 }