saving picked image to coredata with MVVM SWIFTUI

I am trying to get a picked image and put it into my core data record... something like

.sheet(isPresented: $isShowPicker,content:

imagePickerSave(image: $image)       projectVM.projectImage = image!

but something like this seems better but doesnt compile

    imagePickerSave(image: $projectVM.projectImage)

where projectVM is my coredata record

So how do I assign the imagepicker value in the view to a projectimage field in the coredata record?

I am using MVVM, what approach should i using please?

Mark

saving picked image to coredata with MVVM SWIFTUI
 
 
Q