在启用了Stateserver的ASP.NET会话中存储EF4 SelfTracking对象 [英] Store a EF4 SelfTracking Object in ASP.NET Session with Stateserver enabled

查看:68
本文介绍了在启用了Stateserver的ASP.NET会话中存储EF4 SelfTracking对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在我的ASP.NET会话中存储来自Entoty Framework 4的对象。


As我已将sessionState模式切换为Stateserver所有对象,这些对象将保留在StateServer中,必须标记为< serializeable>。


这对我的普通类没有问题,但是即使在将它们标记为< serializeable>之后,EF4生成的自跟踪实体也会产生很大的问题。他们抛出异常。


任何想法?


Christoph Schuster

Weltretter.com

解决方案

嗨Christoph,


 


我注意到 Ivan Perez 在此ADO.NET团队博客文章的评论中提出了类似的问题,
http://blogs.msdn.com/b/adonet/archive/2009/11/15/updated-feature-ctp-walkthrough-self- tracking-entities-for-entity-framework.aspx   


 


幸运的是,上个月ADO.NET团队发布了另一篇博客文章来解决这个问题,
http ://blogs.msdn.com/b/adonet/archive/2010/05/26/using-binary-serialization-and-viewstate-with-self-tracking-entities.aspx <跨度style ="font-family:Calibri">。   


 


这个博客是否解决了这个问题?
  


 


美好的一天!


 


 


最好的问候,

灵芝太阳


MSDN订阅者支持
在论坛


如果您对我们的支持有任何反馈,请联系
msdnmg@microsoft.com


Hi,

i would like to store a Object from the Entoty Framework 4 in my ASP.NET Session.

As i have switched the sessionState mode to Stateserver all objects, which will be persisted in the StateServer, must be marked as <serializeable>.

This is no problem for my normal classes, but the EF4 generated self tracking entities make big problems, even after marking them as <serializeable> they throw exceptions.

any ideas?

Christoph Schuster
Weltretter.com

解决方案

Hi Christoph,

 

I noticed that Ivan Perez raised a similar problems as well in the comments of this ADO.NET team blog article, http://blogs.msdn.com/b/adonet/archive/2009/11/15/updated-feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx.  

 

Fortunately, last month ADO.NET team posted another blog article to solve this issue, http://blogs.msdn.com/b/adonet/archive/2010/05/26/using-binary-serialization-and-viewstate-with-self-tracking-entities.aspx.   

 

Is the issue solved by this blog?   

 

Good day!

 

 

Best Regards,
Lingzhi Sun

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com


这篇关于在启用了Stateserver的ASP.NET会话中存储EF4 SelfTracking对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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