public void DeleteHardware(HardwareSolutionVM ids) { Solution_Hardware model; using (ApplicationDbContext db = new ApplicationDbContext()) { model = db.Solution_Hardware.FirstOrDefault(x => x.HardwareID == ids.HardwareID && x.SolutionID == ids.SolutionID); model.DateDeleted = DateTime.Now; db.SaveChanges(); } }
public void AddHardwareSolu(HardwareSolutionVM ids) { Solution_Hardware model = new Solution_Hardware() { HardwareID = ids.HardwareID, SolutionID = ids.SolutionID }; using (ApplicationDbContext db = new ApplicationDbContext()) { db.Solution_Hardware.Add(model); db.SaveChanges(); }; }
//adds a hardware to a solution public IHttpActionResult Post(HardwareSolutionVM ids) { _adapter.AddHardwareSolu(ids); return(Ok()); }
//Deletes a hardware from a solution public IHttpActionResult Post(HardwareSolutionVM ids) { //_adapter.DeleteHardware(ids); return(Ok()); }