예제 #1
0
        protected ColumnMapping Column <T>(Expression <Func <TDocument, T> > property)
        {
            var column = new ColumnMapping(GetPropertyInfo(property));

            IndexedColumns.Add(column);
            return(column);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }