How to add image type to EF4 Code First Entity? I need to add a column for thumbnails.
public Image Thumbnail { get; set; }
Thanks!
Images are presented as binary in EF 4
http://thedatafarm.com/blog/data-access/sql-server-2008-data-types-and-entity-framework-4/
You will need to do something like this
public Binary Thumbnail {get; set}
Then convert the image to binary
This link will help you convert the image to binary conversion http://www.dotnetspider.com/resources/6150-Convert-Image-binary-format.aspx
public System.Data.Linq.Binary Thumbnail {get; set}
For those who wonder where the Binary type is, I also believe that you can use byte[]
Binary
byte[]