I have a data access class (visit.cs) that contains
both properties for the instance data from iBatis and
static methods for searching/returning instances of
the Visit class.
This has all worked great until I tried to pass the
Visit class over a web service (using binary
serialization). When I attempt to do this, I get the
error
"IBaticNet.DataMapper.MappedStatements.SelectMappedStatement
is not marked as serializable".
My Visit Class is marked as Serializable and I've
tagged the private field that references the Data
mapper as NonSerializable.
Is what I'm trying to do possible (or advisable)? I
need to relay the data from one system to another and
was hoping to just pass the Visit object rather than
getting an instance of the visit object and copying
it's data to a more web service friendly container.
Here is partial listing of my Visit class:
[Serializable()]
public class Visit : ISerializable
{
[NonSerialized]private static SqlMapper _Mapper =
IBatisNet.DataMapper.Mapper.Instance();
/* Properties omitted for clarity, all are basic types
*/
public static Visit Find(int visitId)
{
return _Mapper.QueryForObject("SelectVisit", visitId)
as Visit;
}
}
Thanks,
Shawn.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com