예제 #1
0
        /// <summary>
        /// Add a patient report to the database
        /// </summary>
        /// <param name="report">The report to be added tp the database</param>
        public async Task <Models.PatientReport> AddPatientReportAsync(Models.PatientReport report)
        {
            var newPatientReport = new DataModel.PatientReport
            {
                PatientId   = report.PatientId,
                ReportTime  = report.Time,
                Information = report.Info
            };

            await _context.AddAsync(newPatientReport);

            await _context.SaveChangesAsync();

            report.Id = newPatientReport.Id;
            return(report);
        }