public List <DataBlockGroupsEntity> Adapt(DataTable dt) { List <DataBlockGroupsEntity> results = new List <DataBlockGroupsEntity>(); foreach (DataRow rw in dt.Rows) { DataBlockGroupsEntity dataBlockGroups = new DataBlockGroupsEntity(); dataBlockGroups = AdaptItem(rw); results.Add(dataBlockGroups); } return(results); }
public DataBlockGroupsEntity AdaptItem(DataRow rw) { DataBlockGroupsEntity result = new DataBlockGroupsEntity(); if (rw.Table.Columns["DataBlockGroupId"] != null) { result.DataBlockGroupId = SafeHelper.GetSafeint(rw["DataBlockGroupId"]); } if (rw.Table.Columns["DataBlockGroupName"] != null) { result.DataBlockGroupName = SafeHelper.GetSafestring(rw["DataBlockGroupName"]); } if (rw.Table.Columns["CustomerReference"] != null) { result.CustomerReference = SafeHelper.GetSafestring(rw["CustomerReference"]); } if (rw.Table.Columns["DataBlocksIds"] != null) { result.DataBlocksIds = SafeHelper.GetSafestring(rw["DataBlocksIds"]); } if (rw.Table.Columns["DataBlocks"] != null) { result.DataBlocks = SafeHelper.GetSafestring(rw["DataBlocks"]); } if (rw.Table.Columns["APIURL"] != null) { result.APIURL = SafeHelper.GetSafestring(rw["APIURL"]); } if (rw.Table.Columns["TradeUp"] != null) { result.TradeUp = SafeHelper.GetSafestring(rw["TradeUp"]); } return(result); }