I have a controller action that I can call and it returns a pdf file from a byte array. This works properly and I can view my document embedded on the page with this razor action:
<embed src="@Url.Action("Preview_PDF", "Doc", new { file_name = @Model })" width="100%" height="100%" type="application/pdf"></embed>
Is there a way to embed the file from a view model instead? for example
<embed src="@Model.file" width="100% " height="100%" type="application/pdf"></embed>
I'm using "return File" from my controller, which is not something that I can set into my model class, as File is a static type, it won't let me declare it as a variable.
How would I be able to embed the file on a page from a model? I can store the file as a byte array, but I do not know how to reconstruct it on the view.