public void Update(VaccinationVM vaccination) { Vaccination fromDB = db.Vaccinations.FirstOrDefault(v => v.Id == vaccination.Id); fromDB.VaccineName = vaccination.VaccineName; fromDB.Consent = vaccination.Consent; fromDB.Date = vaccination.Date; db.Entry(fromDB).State = EntityState.Modified; db.SaveChanges(); }
public void Update(Patient patient) { Patient fromDB = db.Patients.FirstOrDefault(p => p.Id == patient.Id); fromDB.FirstName = patient.FirstName; fromDB.SecondName = patient.SecondName; fromDB.LastName = patient.LastName; fromDB.DateOfBirth = patient.DateOfBirth; fromDB.Gender = patient.Gender; fromDB.SNILS = patient.SNILS; db.Entry(fromDB).State = EntityState.Modified; db.SaveChanges(); }