Esempio n. 1
0
        public void Delete(int idPatient)
        {
            var patient = _postgres.Patient.Find(idPatient);

            var consultations = _postgres.Сonsultation
                                .Where(w => w.IdPatient == idPatient);

            _postgres.RemoveRange(consultations);
            _postgres.Remove(patient);
            _postgres.SaveChanges();
        }
Esempio n. 2
0
 public long Create(Сonsultation consultation)
 {
     _postgres.Сonsultation.Add(consultation);
     _postgres.SaveChanges();
     return(consultation.IdConsultation);
 }