protected override void OnClosed(EventArgs e) { base.OnClosed(e); if (this.session != null) { this.session.Dispose(); this.session = null; } if (Attachments?.Any() ?? false) { Attachments.ForEach(x => { if (x.ContentStream != null) { x.ContentStream.Dispose(); } }); Attachments.Clear(); } }
public TowaryView(BAL.Business.Session session) : base(session.Tables["Towary"]) { }