public void Create(TypeOfCaseViewModel db) { var entity = new TypeOfCase_Table(); entity.TypeOfCase = db.TypeOfCase; entities.TypeOfCase_Table.Add(entity); entities.SaveChanges(); db.TypeOfCaseID = entity.TypeOfCaseID; }
public void Destroy(TypeOfCaseViewModel db) { var entity = new TypeOfCase_Table(); entity.TypeOfCaseID = db.TypeOfCaseID; entities.TypeOfCase_Table.Attach(entity); entities.TypeOfCase_Table.Remove(entity); entities.SaveChanges(); }
public void Update(TypeOfCaseViewModel db) { var entity = new TypeOfCase_Table(); entity.TypeOfCaseID = db.TypeOfCaseID; entity.TypeOfCase = db.TypeOfCase; entities.TypeOfCase_Table.Attach(entity); entities.Entry(entity).State = EntityState.Modified; entities.SaveChanges(); }