public void Add(DetectionHardware DetectionHardware) { var g = (from r in db.DetectionHardwares where r.ID == DetectionHardware.ID select r).FirstOrDefault(); if (g == null) { db.DetectionHardwares.Add(g); db.SaveChanges(); } }
public void Update(DetectionHardware DetectionHardware) { var g = (from r in db.DetectionHardwares where r.ID == DetectionHardware.ID select r).FirstOrDefault(); if (g != null) { db.Entry(g).CurrentValues.SetValues(DetectionHardware); db.SaveChanges(); } else { db.DetectionHardwares.Add(DetectionHardware); db.SaveChanges(); } }
public void Update(DetectionHardware DetectionHardware) { throw new System.NotImplementedException(); }