public void AddNewFamily(Family family) { int max = Families.Max(family => family.Id); family.Id = (++max); Families.Add(family); SaveChanges(); }