类:Pet 包含属性 IList<Cat>.先创建IList<Pet>。然后序列化该数组报错。
请问有没解决方法?
请问有没解决方法?
解决方案 »
- 如何调用这样的API
- c#调用delphi dll问题
- 郁闷拉。如何取Button的name属性和text属性
- 我写在自定义控件里面的,父类是RichTextBox,重写 WndProc 以后 m.Msg 为什么没有捕获到 0x0302 的代码呢?
- 请问下面的数学公式如何用C#表达出来,谢谢
- 求教在C#中使用OCX控件时出现的函数传参数问题
- 如何用oledb打开EXCEL 5.0/95文件?
- 如何访问DataSet中已被删除的数据行?
- 求在线等,请高手帮帮忙!关于ASP和SQL Server结合做下载技术
- ☆我的.NET框架 SDK 文档也就是我的VS.net帮助文档,只要一运行就会自己关闭,请问怎么解决☆
- 如何用DataGridView显示存储过程返回数据集
- datagridview列标题特殊符号
[Serializable]
public class BusinessType
{
public virtual string Id
{
get { return _id; }
set { _id = value; }
}
public virtual string Name
{
get { return _name; }
set { _name = value; }
}
public virtual IList<Module> ListModule
{
get { return _listModule; }
set { _listModule = value; }
}
} [Serializable]
public class Module
{
public virtual string Id
{
get { return _id; }
set { _id = value; }
}
public virtual string Name
{
get { return _name; }
set { _name = value; }
}
}IList<BusinessType> b = new IList<BusinessType>();
现在序列化b报错。就是问题没法序列化IList<Module> ListModule,说是接口问题。
// 摘要:
// 指示一个类可以序列化。无法继承此类。
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)]
[ComVisible(true)]
public sealed class SerializableAttribute : Attribute
{
// 摘要:
// 初始化 System.SerializableAttribute 类的新实例。
public SerializableAttribute();
}明显不支持接口
我试过了。这样NHibernate对象实例化的时候报错。