public static void Delete(people person) { var target = One(p => p.Id == person.Id); if (target != null) { All().Remove(target); } }
public static void Update(people person) { var target = One(p => p.Id == person.Id); if (target != null) { target.Name = person.Name; target.Address = person.Address; target.Phone_Number = person.Phone_Number; } }
public static void Insert(people person) { var first = All().OrderByDescending(p => p.Id).FirstOrDefault(); if (first != null) { person.Id = first.Id + 1; } else { person.Id = 0; } All().Insert(0, person); }