public bool Update(Location model) { try { var bug = _dbContext.location.Single(x => x.id == model.id); bug.locationname = model.locationname; _dbContext.Update(bug); _dbContext.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }
public bool Update(Machine model) { try { var bug = _machineDbContext.machine.Single(x => x.machineID == model.machineID); bug.machineID = model.machineID; bug.description = model.description; bug.locationID = model.locationID; _machineDbContext.Update(bug); _machineDbContext.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }
public bool Update(Student model) { try { var bug = _studentDbContext.Student.Single(x => x.StudentId == model.StudentId); bug.Name = model.Name; bug.LastName = model.LastName; bug.Bio = model.Bio; _studentDbContext.Update(bug); _studentDbContext.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }