Are Linq to sql objects serializable for session state?

后端 未结 3 1788
猫巷女王i
猫巷女王i 2021-01-03 05:32

Without going into whether this is a good or bad idea:

Is it possible to store a LINQ-to-SQL domain object in the ASP.NET Session, when the session is ou

3条回答
  •  [愿得一人]
    2021-01-03 06:04

    I would believe that you would need to mark your objects as being serializable. I'm not sure if there is way to do this for all the generated objects, but for those that you are putting into session, you could create a partial class (e.g. of Lion) and give it the Serializable attribute.

提交回复
热议问题