public async Task<Patient> UpdateAsync(Patient patient) { using (var uow = _uowFac.Create()) { uow.PatientRepository.Update(patient); await uow.SaveChangesAsync(); return patient; } }
public async Task<Patient> AddPatientAsync(Guid childId, Guid pediaId) { using (var uow = _uowFac.Create()) { var patient = new Patient() { ChildId = childId, PediaId = pediaId }; uow.PatientRepository.Insert(patient); await uow.SaveChangesAsync(); //var list = await uow.PatientRepository.Items.Include(p => p.Pedia).ToListAsync(); return patient; } }
public async Task<Patient> InsertAsync(Patient patient) { using (var uow = _uowFac.Create()) { patient.Id = new Guid(); uow.PatientRepository.Insert(patient); await uow.SaveChangesAsync(); return patient; } }