internal DataSourceDto CreateDto() { DataSourceDto dto = new DataSourceDto(); dto.Dao = this.dao; dto.Name = this.Name; dto.ConversionFunction = (int)this.conversionFunction; dto.Range = this.range.CreateDto(); dto.PollingInterval = this.PollingInterval; if (this.lastReading != null) { dto.LastReading = this.lastReading.CreateDto(); } dto.Stats = this.stats.CreateDto(); foreach (Archive ar in this.archives) { dto.AddArchive(ar.CreateDto()); } return(dto); }