public static void SaveSerializedReport(string sessionId, Report report) { IDiskCacheGroup group = GetReportCacheGroup(sessionId); group.Delete(); BinaryFormatter formatter = CreateBinaryFormatter(); using (Stream stream = group.OpenFile(SerializedReportFileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Delete)) formatter.Serialize(stream, report); }
public static void ClearSerializedReport(string sessionId) { IDiskCacheGroup group = GetReportCacheGroup(sessionId); group.Delete(); }