public static DicDataEntity[] DataTableToEntitys(DataTable dt) { if (dt == null) return null; var results = new DicDataEntity[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { results[i] = DataRowToEntity(dt.Rows[i]); } return results; }
public static DicDataEntity DataRowToEntity(DataRow row) { if (row == null) return null; var result = new DicDataEntity() { DicType = (string)row["DicType"], DicValue = (string)row["DicValue"] }; return result; }