public void SaveRecord() { var context = new IPSASDbContext(); context.Attach(Record); context.Entry(Record).State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); }
public void SaveChanges() { foreach (var recordVM in _payrollRecords.Distinct()) { context.Attach(recordVM.Record); context.Entry(recordVM.Record).State = EntityState.Modified; App.ServiceProvider.GetService <PayslipViewModel>().UpdatePayrollRecord(recordVM.Record); } context.SaveChanges(); MessageBox.Show("Fiche de pointage enregistré"); }