【发布时间】:2011-06-15 17:56:25
【问题描述】:
具体来说,我们正在使我们的应用程序与进程外会话状态服务器兼容,其中保存在会话中的所有类型都必须是可序列化的。
有没有办法在编译时查看放入 HttpSessionState 的任何类型都标有 Serializable 属性。类似于此“无效”代码的内容
public static void Put<T>( string key, T value ) where T : IsMarkedWitheSerializableAttribute
{
HttpContext.Current.Session[key] = value;
}
【问题讨论】:
标签: c# asp.net .net-3.5 session-state compile-time