Saving an Image using entity framework CodeFirst?

You can use byte datatype on your objects, for Sql you can use varbinary(max) (as image data type will be removed from future sql version. MSDN - Image datatype.

Up vote 1 down vote favorite share g+ share fb share tw.

I am new to entity framework and I am trying to go the Code First approach. When defining one of my model classes I want one of the objects in the class to map to a Image column in my Sql Server Database. What object type would I use here so that when the table is created it would make that column an Image column?

C# asp.net" rel="nofollow">asp.net asp.net" rel="nofollow">asp.net-mvc-3 entity-framework entity-framework-4 link|improve this question asked Feb 4 at 17:54esastincy4209 100% accept rate.

You can use byte datatype on your objects, for Sql you can use varbinary(max) (as image data type will be removed from future sql version. MSDN - Image datatype public byte yourFiles{get;set;} you can configure like this using fluent api modelBuilder.Entity(). Property(p => p.

YourFiles). HasColumnName("yourColumnName"). HasMaxLength(SomeLength).

HasColumnType("varbinary").

– esastincy Feb 4 at 17:58 @esastincy check uodated ans. – Ravi Feb 4 at 18:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions