摘要:
用NHibernate進行數據庫的ORM操作, 很多清況下都免不了要生成像IList這種泛型接口的對象集合.但是如果再用到Web Service來進行這種對象的傳輸的話, 就會報錯.原因是IList為接口類型, 不能被序列化.以下方法解 //要用到的主要類using System.Runtime.Serialization.Formatters.Binary;using System.Runti... 阅读全文
posted @ 2008-03-28 19:46
巍巍边疆
阅读(460)
评论(0)
推荐(0)
摘要:
定义一个ArrayList,存放Int,String等基本类型可以被序列化。 自定义一个类,也可以被序列化。 但是把类添加到ArrayList,序列化有点问题,后来发现需要制定ExtraType[]参数。 [WebMethod] public string SerializeQuestionsByDatetime() { ArrayList question... 阅读全文
posted @ 2008-03-28 19:41
巍巍边疆
阅读(2547)
评论(0)
推荐(0)
摘要:
所谓自定义类,不知道我有没有表达清楚,这里指的就是petshop中的Model层实体类了。 比如以下代码: using System;using System.Collections;using System.Collections.Generic;using System.Text;namespace Model{ [Serializable] public c... 阅读全文
posted @ 2008-03-28 19:40
巍巍边疆
阅读(461)
评论(1)
推荐(0)
摘要:
using System;using System.Collections;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Serialization;[WebService(Namespace = "http://tempuri.org/")][We... 阅读全文
posted @ 2008-03-28 19:36
巍巍边疆
阅读(981)
评论(0)
推荐(0)