public static void UpdateName(AgendaTelefonicaEntities context) { var res = from c in context.Agenda where c.Nume.Equals("Ticlos") && c.Prenume.Equals("Olimpia") select c; if (res.Count() == 0) { return; } res.FirstOrDefault().Prenume = "Iustina"; context.SaveChanges(); }
public static void DeletePop(AgendaTelefonicaEntities context) { var res = from c in context.Agenda where c.Nume.Contains("Pop") select c; if (res.Count() == 0) { return; } context.Agenda.Remove(res.FirstOrDefault()); context.SaveChanges(); }