static void updateContatto(string tipo, PersonaDTO persona, string valore, SferaService service, UserInfo info) { var dto = persona.Contatti.FirstOrDefault(item => item.TipoContatto.ToUpper() == tipo); if (dto != null) dto.Valore = valore; else dto = new ContattoDTO { TipoContatto = tipo, Valore = valore, CodiceRiferimento = persona.ID}; dto.Stato = "U"; service.SetContatto(dto, info); }