protected ColumnMapping Column <T>(Expression <Func <TDocument, T> > property) { var column = new ColumnMapping(GetPropertyInfo(property)); IndexedColumns.Add(column); return(column); }
protected ColumnMapping VirtualColumn <TProperty>(string name, DbType databaseType, Func <TDocument, TProperty> reader, Action <TDocument, TProperty> writer = null, int?maxLength = null, bool nullable = false) { var column = new ColumnMapping(name, databaseType, new DelegateReaderWriter <TDocument, TProperty>(reader, writer)); IndexedColumns.Add(column); if (maxLength != null) { column.MaxLength = maxLength.Value; } column.IsNullable = nullable; return(column); }
public IndexedColumn AddColumn(IndexedColumn column) { if (column == null) { throw new ArgumentNullException(nameof(column)); } if (IndexedColumns == null) { IndexedColumns = new List <IndexedColumn>(); } column.OrdinalPosition = IndexedColumns.Count + 1; IndexedColumns.Add(column); return(column); }