You need two properties one to get file input and other to store the image in base64 form.
Include enctype="multipart/form-data" attribute in the form tag to post files.
Controller's post Action method Convert Input image file from IFormFile to base64 and store in the string property.
Before send image string base64 to view convert its string in the following way.
Finally Show your Image on View.