I have an MVC website and want to add an image to my model and display it in my view.
Currently, this is what my model looks like.
Model:
public class EventModel
{
public string Title { get; set; }
public string Location { get; set; }
public byte[] EventLogo { get; set; }
public string Description { get; set; }
}
For now, I have saved an image in my project under Content/Images/Logo-1.jpeg
I have not much knowledge on how I can save a image path to an array of byte. I suppose I would have to convert it first. Or is there an alternative data type i can use to save an image. Please advise.