private int GetParentId(IParent parent) { if (parent is BusinessBase) { Object retval = parent.GetType().GetProperty("Id").GetValue(parent); return (int) retval; } return GetParentId(parent.Parent); }
protected override void OnTearDown() { using (var s = Sfi.OpenSession()) { using (var tx = s.BeginTransaction()) { s.Delete("from " + storedParent.GetType()); tx.Commit(); } } }