EntityFramework 5(Model First)和SQLCE:什么'Type'属性存储图像? [英] EntityFramework 5 (Model First) and SQLCE: what 'Type' property to store an image?

查看:345
本文介绍了EntityFramework 5(Model First)和SQLCE:什么'Type'属性存储图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

框架:
在asp.net MVC 4项目中,我首次使用EntityFramework 5,并且由于模型实现的轻松而选择使用Model First (使用设计器创建模型后,生成数据库模式的能力)。另外,根据项目的轻量级性质和要求,我选择使用SQLCE反对SQLExpress。

Framework: In an asp.net MVC 4 project I'm using EntityFramework 5 for the first time and have chosen to use "Model First" due to the ease of model implementation (the ability to generate the db schema once the model is created using the designer). Also, I've chosen to use SQLCE opposed to SQLExpress based on the lightweight nature and requirements of the project.

问题:
什么是最好的属性.edmx设计器中的类型选择用于在紧凑的sql数据库中保存图像?我想我可以将图像转换为二进制(就像我以前的Web表单项目中所做的那样),但是没有varbinary(max)的选项。

Question: What is the best property Type selection in the .edmx designer for saving images in the compact sql database? I'm thinking I could convert the image to binary (as I've done in previous web forms projects) but there's no option for varbinary(max).

推荐答案

EDIT
您可以将属性类型定义为binary,并将SqlType定义为image

EDIT You can define Property Type to "binary" and Map SqlType like "image"

这篇关于EntityFramework 5(Model First)和SQLCE:什么'Type'属性存储图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆