使用实体框架在Wcf数据服务中发送大字节数组 [英] Send big byte array in Wcf data service with entity framework

查看:124
本文介绍了使用实体框架在Wcf数据服务中发送大字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Wcf数据服务而不是Wcf服务。我的服务由EntityFrameworkDataService实现并使用实体框架。我的数据库中的Book模型包含其类型为byte []的image属性。将书籍实例发送到wcf数据服务时,我会收到此RequestEntityTooLarge错误消息。

I am using Wcf Data Service not Wcf Service. My service implemented by EntityFrameworkDataService and using entity framework. I have Book model in my database that hold image property that its type is byte[]. when send a book instance to wcf data service I recive this "RequestEntityTooLarge" error message.

推荐答案

您可以在实现服务的主机上以文件的形式存储图像。这些文件应该有唯一的文件名;并且数据库只能存储文件名。这是一种非常常用的方法。



-SA
You can store images in the form of files on the host implementing the service. Those files should have unique file names; and the database can store only the file names. This is a pretty usual approach.

—SA


这篇关于使用实体框架在Wcf数据服务中发送大字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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