public void Delete(project dbItem) { context.projects.Remove(dbItem); context.SaveChanges(); }
public void Save(project dbItem) { if (dbItem.id == 0) //create { context.projects.Add(dbItem); } else //edit { var entry = context.Entry(dbItem); entry.State = EntityState.Modified; } context.SaveChanges(); }