I have a class with a property of type System.Drawing.Image because I want to store images in it. When trying to scaffold a Web API controller with Entity Framework Core I get the error message:
I think the problem is that the System.Drawing.Image class has a "Tag" property of type object. Now, the question is how do I fix this mapping?
Option 1:
Instead of using
System.Drawing.Imagedirectly in EF mapping, you could map the data to another property of typebyte[]Option 2:
You could also leave only the
ImageDataproperty in the model and handle loading and saving the image outside the model.