public DataSourceConfigurationEntity AdaptItem(DataRow rw, DataTable dt) { DataSourceConfigurationEntity result = new DataSourceConfigurationEntity(); if (dt.Columns.Contains("Id")) { result.Id = SafeHelper.GetSafeint(rw["Id"]); } if (dt.Columns.Contains("ExternalDataStoreName")) { result.ExternalDataStoreName = SafeHelper.GetSafestring(rw["ExternalDataStoreName"]); } if (dt.Columns.Contains("ExternalDataStoreTypeId")) { result.ExternalDataStoreTypeId = SafeHelper.GetSafeint(rw["ExternalDataStoreTypeId"]); } if (dt.Columns.Contains("DataStoreConfiguration")) { result.DataStoreConfiguration = SafeHelper.GetSafestring(rw["DataStoreConfiguration"]); } if (dt.Columns.Contains("UserId")) { result.UserId = SafeHelper.GetSafeint(rw["UserId"]); } return(result); }
public List <DataSourceConfigurationEntity> Adapt(DataTable dt) { List <DataSourceConfigurationEntity> results = new List <DataSourceConfigurationEntity>(); foreach (DataRow rw in dt.Rows) { DataSourceConfigurationEntity matchCode = new DataSourceConfigurationEntity(); matchCode = AdaptItem(rw, dt); results.Add(matchCode); } return(results); }