public bool AttachImage(Guid patientId, Stream file) { var patient = _dbContext.Patients.FirstOrDefault(x => x.Id == patientId); if (patient == null) { return(false); } var url = _storageHandler.StoreFile(file); patient.Image = url; _dbContext.SaveChanges(); return(true); }