private void InitializeMembers(StreamingContext context) { this.cachedVersion = DateTime.Now.Ticks; this.isCacheable = false; this.name = String.Empty; this.defaultSchemaName = String.Empty; this.connectionString = null; this.tables = new DatabaseObjectCollection <Table>(this); this.views = new DatabaseObjectCollection <View>(this); this.tableValuedFunctions = new DatabaseObjectCollection <TableValuedFunction>(this); this.scalarFunctions = new DatabaseObjectCollection <ScalarFunction>(this); this.storedProcedures = new DatabaseObjectCollection <StoredProcedure>(this); this.statistics = new LazyProperty <DatasetStatistics>(LoadDatasetStatistics); this.metadata = new LazyProperty <DatasetMetadata>(LoadDatasetMetadata); InitializeEventHandlers(); }
/// <summary> /// Copies member variables /// </summary> /// <param name="old"></param> private void CopyMembers(DatasetBase old) { this.cachedVersion = DateTime.Now.Ticks; this.isCacheable = old.isCacheable; this.name = old.name; this.defaultSchemaName = old.defaultSchemaName; this.connectionString = old.connectionString; // No deep copy here this.tables = new DatabaseObjectCollection <Table>(this); this.views = new DatabaseObjectCollection <View>(this); this.tableValuedFunctions = new DatabaseObjectCollection <TableValuedFunction>(this); this.scalarFunctions = new DatabaseObjectCollection <ScalarFunction>(this); this.storedProcedures = new DatabaseObjectCollection <StoredProcedure>(this); this.statistics = new LazyProperty <DatasetStatistics>(LoadDatasetStatistics); this.metadata = new LazyProperty <DatasetMetadata>(LoadDatasetMetadata); InitializeEventHandlers(); }