//添加 public static T AddEntities(T entity) { db.Entry <T>(entity).State = EntityState.Added; db.SaveChanges(); return(entity); }