internal void CreateProfile() { profile = new Profile(); profile.SetName(model.nome); if (model.telefones != null) { foreach (var telphoneModel in model.telefones) { var tel = new Telphone(); tel.SetPrefix(int.Parse(telphoneModel.ddd)); tel.SetNumber(telphoneModel.numero); profile.AddTelphone(tel); } } }
public void AddTelphone(Telphone tel) { Assertion.IsFalse(tel == null, "Informe um telefone válido."); Telphones.Add(tel); }