c# - Making a non-serializable vendor class serializable -
i using class vendor's dll not xml serializable because 1 of class members interface.
however, need serialize instance of class.
how can tell xmlserializer ignore interface , serialize else?
you can 2 things:
1) create class every thing want, populate vendor class, serialize it.
check adapter design pattern
2) use json.net. once need serialize ipagedlist have metadata , did this:
public static string serializepagedlist(ipagedlist<t> pagedlist) { string result = jsonconvert.serializeobject( // new anonymous class wanted new { items = pagedlist, metadata = pagedlist.getmetadata() }, new jsonserializersettings { nullvaluehandling = nullvaluehandling.ignore, referenceloophandling = referenceloophandling.ignore }); return result; }
i hope helps.
Harrah's Cherokee Casino & Hotel - MapyRO
ReplyDeleteHarrah's Cherokee Casino & 논산 출장샵 Hotel is 양산 출장마사지 Cherokee, North Carolina's North Carolina's closest casino 광주 출장샵 and gambling 구리 출장안마 capital of the Southeast.Renovated in 2019, Harrah's Cherokee Casino & Hotel is an 군포 출장안마 Indian casino and