简体   繁体   English

如何在Entity Framework 4.0模型的第一个设计器中添加文件流列?

[英]How to add a filestream column in the Entity Framework 4.0 model first designer?

I'm using the EF 4.0 designer to create a database by clicking on "Generate Database from Model". 我正在使用EF 4.0设计器通过单击“从模型生成数据库”来创建数据库。 I wan't to use the sql 2008 column type "filestream". 我不想使用sql 2008列类型“ filestream”。 Unfortunately I can't select "filestream" from Type DropDownList of a specific column. 不幸的是,我无法从特定列的类型DropDownList中选择“文件流”。

So, how do I use the filestream with EF 4.0 model first? 那么,如何首先将文件流与EF 4.0模型一起使用?

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. 到目前为止,我已经搜索了一些SQL脚本以手动添加此类列,但通过SQL脚本添加它们意味着我的模型中没有这些列。 What should I do? 我该怎么办?

Entity framework doesn't support Filestream . 实体框架不支持Filestream Even if you add it, it will still be used as any other varbinary(max) column. 即使添加它,它也仍将用作任何其他varbinary(max)列。 To use Filestream during database generation you must use custom structural annotation and modify generation template . 要在数据库生成期间使用Filestream ,必须使用自定义结构注释并修改生成模板

The varbinary(max) binary large object (BLOB) data is stored as files on the file system. varbinary(max)二进制大对象(BLOB)数据作为文件存储在文件系统上。 There is not a sql type named FILESTREAM. 没有名为FILESTREAM的sql类型。 It is an attribute for BLOB data stored in varbinary(MAX) columns. 它是存储在varbinary(MAX)列中的BLOB数据的属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将主键标识列添加到实体框架代码首先生成的模型 - How do I add a Primary Key identity column to Entity Framework Code First generated Model 如何先在实体框架模型中添加关系属性? - How to add relationship attributes in entity framework model first? 实体框架模型第一列关键列 - Entity framework model first foregin key column 实体框架数据库第一列未显示在模型中 - Entity Framework Database First Column not showing in model 实体框架6模型第一:如何在基本实体已存在时添加继承实体 - Entity Framework 6 Model First: how to add inherited entity when base entity already exist 实体框架4.0模型从数据库更新模型后,第一次继承会丢失 - Entity Framework 4.0 Model First inheritance is lost after updating model from database 首先在数据库实体框架模型内部填充列默认值 - Populate Column Default Value Inside Database Entity Framework Model First 如何最好地手动使用Entity Framework Code First模型类处理现有数据库列映射? - How best to handle existing database column mappings with an Entity Framework Code First model class manually? 如何从C#Entity Framework Code First Model获取mysql char列类型 - How to get mysql char column type from C# Entity Framework Code First Model Entity Framework代码优先:如何在模型上添加更多道具并更新数据库? - Entity Framework code-first : how to add more props on model and update database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM