如何在Entity Framework 4.0模型中设计一个filestream列? [英] How to add a filestream column in the Entity Framework 4.0 model first designer?

查看:161
本文介绍了如何在Entity Framework 4.0模型中设计一个filestream列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EF 4.0设计器通过点击从模型生成数据库来创建数据库。
我不会使用sql 2008列类型filestream。
不幸的是,我不能从一个特定列的类型DropDownList中选择filestream。

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.

那么,我如何首先使用EF 4.0模式的filestream?

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

到目前为止,我已经搜索了一些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?

推荐答案

实体框架不支持 Filestream 。即使添加它,它仍将被用作任何其他 varbinary(max)列。要在数据库生成期间使用 Filestream ,您必须使用自定义结构性注释和修改生成模板

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.

这篇关于如何在Entity Framework 4.0模型中设计一个filestream列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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