private void SetProperty <T>(Table table, Row row, Column column, DynaRow <T> bean) { string name = column.Name; string textValue = GetValue(row, name); DynaColumn property = bean.DynaType[column.Name]; object value = ToObject(name, property.Type, property.ComponentType, textValue, table, row); ((IDictionary)bean.Instance)[name] = value; }
private object ToObject(DynaColumn column, string textValue, Table table, Row row) { object value = ToObject(column.Name, column.Type, column.ComponentType, textValue, table, row); if (value == null) { return(DBNull.Value); } return(value); }
private DataTable CreateDataTable(Table table) { DataTable dataTable = new DataTable(table.Name); foreach (Column column in table.Columns) { if (column != null) { Type type = new DynaColumn(column).Type; DataColumn dataColumn = new DataColumn(column.Name, type); dataTable.Columns.Add(dataColumn); } } return(dataTable); }