如何在实体框架4.0模型首任设计师添加FILESTREAM列? [英] How to add a filestream column in the Entity Framework 4.0 model first designer?

查看:212
本文介绍了如何在实体框架4.0模型首任设计师添加FILESTREAM列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是EF 4.0设计者可以通过点击从模型中生成数据库来创建数据库。
我wan't使用SQL 2008列类型FILESTREAM。
不幸的是,我不能从一个特定的列类型DropDownList中选择文件流。

I'm using the EF 4.0 designer to create a database by clicking on "Generate Database from Model". I wan't to use the sql 2008 column type "filestream". Unfortunately I can't select "filestream" from Type DropDownList of a specific column.

那么,我该如何使用FILESTREAM与EF 4.0模型第一?

So, how do I use the filestream with EF 4.0 model first?

到目前为止,我GOOGLE了一些SQL脚本来手动添加这样的列,而是通过SQL脚本添加它们意味着我没有他们在我的模型。我应该怎么办?

So far I've googled some SQL scripts to manually add such columns, but adding them via SQL script means that I don't have them in my model. What should I do?

推荐答案

实体框架不支持文件流。即使你添加它,它仍然被用作其他任何 VARBINARY(最大)列。要使用文件流数据库生成过程中,你必须使用<一个href=\"http://stackoverflow.com/questions/5912839/how-do-i-use-structural-annotations-to-set-sql-type-to-date-in-model-first-approa/5924143#5924143\">custom结构注释和修改生成模板。

Entity framework doesn't support Filestream. Even if you add it, it will still be used as any other varbinary(max) column. To use Filestream during database generation you must use custom structural annotation and modify generation template.

这篇关于如何在实体框架4.0模型首任设计师添加FILESTREAM列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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