public void addNewTruckModel(IndividualTruck truck) { using (GSQ2_Brayden_ProjectContext ctx = new GSQ2_Brayden_ProjectContext()) { ctx.IndividualTruck.Add(truck); ctx.SaveChanges(); } }
public void updateTruck(IndividualTruck tk) { using (GSQ2_Brayden_ProjectContext ctx = new GSQ2_Brayden_ProjectContext()) { ctx.Entry(tk).State = Microsoft.EntityFrameworkCore.EntityState.Modified; ctx.Entry(tk.TruckFeatureAssociation).State = Microsoft.EntityFrameworkCore.EntityState.Modified; ctx.SaveChanges(); } }
public void updateTruckModel(TruckModel tk) { using (GSQ2_Brayden_ProjectContext ctx = new GSQ2_Brayden_ProjectContext()) { ctx.Entry(tk).State = Microsoft.EntityFrameworkCore.EntityState.Modified; ctx.Entry(tk.IndividualTruck).State = Microsoft.EntityFrameworkCore.EntityState.Modified; ctx.SaveChanges(); } }