/// <summary> /// Returns a list of generated relations for this table to views /// </summary> /// <returns></returns> public ViewRelationCollection GetViewRelations() { try { var retval = new ViewRelationCollection(this.Root); foreach (var r in this.ViewRelationships.AsEnumerable()) { var relation = r.Object as ViewRelation; if (relation != null) { if (relation.ChildView.Generated) retval.Add(relation); } } return retval; } catch (Exception ex) { throw; } }
//private DateTime _createdDate = DateTime.Now; #endregion #region Constructor public Database(INHydrateModelObject root) : base(root) { _tables = new TableCollection(root); _tables.ResetKey(Guid.Empty.ToString()); _columns = new ColumnCollection(root); _columns.ResetKey(Guid.Empty.ToString()); _relations = new RelationCollection(root); _relations.ResetKey(Guid.Empty.ToString()); _viewRelations = new ViewRelationCollection(root); _viewRelations.ResetKey(Guid.Empty.ToString()); _customViews = new CustomViewCollection(root); _customViews.ResetKey(Guid.Empty.ToString()); _customAggregates = new CustomAggregateCollection(root); _customAggregates.ResetKey(Guid.Empty.ToString()); _customStoredProcedures = new CustomStoredProcedureCollection(root); _customStoredProcedures.ResetKey(Guid.Empty.ToString()); _customViewColumns = new CustomViewColumnCollection(root); _customViewColumns.ResetKey(Guid.Empty.ToString()); _customAggregateColumns = new CustomAggregateColumnCollection(root); _customAggregateColumns.ResetKey(Guid.Empty.ToString()); _customStoredProcedureColumns = new CustomStoredProcedureColumnCollection(root); _customStoredProcedureColumns.ResetKey(Guid.Empty.ToString()); _customRetrieveRules = new CustomRetrieveRuleCollection(root); _customRetrieveRules.ResetKey(Guid.Empty.ToString()); _customRetrieveRuleParameters = new ParameterCollection(root); _customRetrieveRuleParameters.ResetKey(Guid.Empty.ToString()); _functionParameters = new ParameterCollection(root); _functionParameters.ResetKey(Guid.Empty.ToString()); _functions = new FunctionCollection(root); _functions.ResetKey(Guid.Empty.ToString()); _functionColumns = new FunctionColumnCollection(root); _functionColumns.ResetKey(Guid.Empty.ToString()); this.PrecedenceOrderList = new List<Guid>(); }