From ce5f7a5d8ceae0e8cbb51f01624af626b456cff9 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Thu, 19 Oct 2023 10:35:18 +1100 Subject: [PATCH] Save image metadata to database --- FIT5032-Assignment/Controllers/AppointmentsController.cs | 1 + FIT5032-Assignment/Controllers/HomeController.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/FIT5032-Assignment/Controllers/AppointmentsController.cs b/FIT5032-Assignment/Controllers/AppointmentsController.cs index e4f6d1d..c4c3150 100644 --- a/FIT5032-Assignment/Controllers/AppointmentsController.cs +++ b/FIT5032-Assignment/Controllers/AppointmentsController.cs @@ -473,6 +473,7 @@ namespace FIT5032_Assignment.Controllers { file = fileName, status = 0, }; + db.Images.Add(dbImage); // Change appointment status to 2 appointment.status = 2; db.Entry(appointment).State = EntityState.Modified; diff --git a/FIT5032-Assignment/Controllers/HomeController.cs b/FIT5032-Assignment/Controllers/HomeController.cs index 04b3f9e..4710316 100644 --- a/FIT5032-Assignment/Controllers/HomeController.cs +++ b/FIT5032-Assignment/Controllers/HomeController.cs @@ -52,6 +52,7 @@ namespace FIT5032_Assignment.Controllers { public DbSet Patients { get; set; } public DbSet Doctors { get; set; } public DbSet Appointments { get; set; } + public DbSet Images { get; set; } } public class HomeController : Controller { public static string GetMd5Hash(string input) {