private RowObjectAdapter Bind(Selector columnNames) { foreach (PropertyInfo propertyInfo in Reflex.GetColumnProperties(obj)) { ColumnAttribute attribute = Reflex.GetColumnAttribute(propertyInfo); if (attribute != null && this.Row.Table.Columns.Contains(attribute.ColumnNameSaved)) { DataField field = this.fields.Add(attribute.ColumnNameSaved, attribute.Type); ColumnAdapter column = new ColumnAdapter(field); this.Bind(column); column.Field.Identity = attribute.Identity; column.Field.Primary = attribute.Primary; if (attribute.Identity || attribute.Computed || ! columnNames.Exists(attribute.ColumnNameSaved)) column.Field.Saved = false; else column.Field.Saved = attribute.Saved; } } //in case of ColumnAttribute not setup Identity and Primary Keys fields.UpdatePrimaryIdentity(obj.Primary, obj.Identity); return this; }
private RowObjectAdapter Bind(Selector columnNames) { foreach (PropertyInfo propertyInfo in Reflex.GetColumnProperties(obj)) { ColumnAttribute attribute = Reflex.GetColumnAttribute(propertyInfo); if (attribute != null && this.Row.Table.Columns.Contains(attribute.ColumnNameSaved)) { DataField field = this.fields.Add(attribute.ColumnNameSaved, attribute.Type); ColumnAdapter column = new ColumnAdapter(field); this.Bind(column); column.Field.Identity = attribute.Identity; column.Field.Primary = attribute.Primary; if (attribute.Identity || attribute.Computed || !columnNames.Exists(attribute.ColumnNameSaved)) { column.Field.Saved = false; } else { column.Field.Saved = attribute.Saved; } } } //in case of ColumnAttribute not setup Identity and Primary Keys fields.UpdatePrimaryIdentity(obj.Primary, obj.Identity); return(this); }
protected ColumnAdapter Bind(ColumnAdapter column) { columns.Bind(column); column.UpdateValue(this.dataRow); return(column); }
protected ColumnAdapter Bind(ColumnAdapter column) { columns.Bind(column); column.UpdateValue(this.dataRow); return column; }