Example #1
0
 public void Delete(project dbItem)
 {
     context.projects.Remove(dbItem);
     context.SaveChanges();
 }
Example #2
0
 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();
 }