{"id":391,"date":"2013-05-20T11:25:29","date_gmt":"2013-05-20T11:25:29","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=391"},"modified":"2013-05-20T11:25:29","modified_gmt":"2013-05-20T11:25:29","slug":"storing-binary-data-using-entity-framework","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/storing-binary-data-using-entity-framework\/","title":{"rendered":"Storing binary data using Entity Framework"},"content":{"rendered":"<p>This is a real quick post, not my usual verbose ramblings :)<\/p>\n<p>If you want to store binary data within a database column using Code First, then store the data as a byte array (see below).<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\npublic class SomeData\r\n{\r\n   \/\/ properties etc.\r\n\r\n   \/\/ binary data, will be converted to a varbinary(max) in SQL Server\r\n   public byte&#x5B;] Data { get; set; }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a real quick post, not my usual verbose ramblings :) If you want to store binary data within a database column using Code First, then store the data as a byte array (see below). public class SomeData { \/\/ properties etc. \/\/ binary data, will be converted to a varbinary(max) in SQL Server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-entity-framework"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":393,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions\/393"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}