示例#1
0
        /// <summary>
        /// Use a list collection
        /// </summary>
        public T AsList()
        {
            collectionBuilder = attrs => new ListMapping(attrs);
            CreateIndexMapping(null);

            if (indexMapping.Columns.IsEmpty())
            {
                indexMapping.AddDefaultColumn(new ColumnMapping {
                    Name = "Index"
                });
            }

            return((T)this);
        }
示例#2
0
        public T AsIndexedCollection <TIndex>(string indexColumn, Action <IndexPart> customIndexMapping)
        {
            CreateIndexMapping(customIndexMapping);

            if (!indexMapping.IsSpecified("Type"))
            {
                indexMapping.SetDefaultValue(x => x.Type, new TypeReference(typeof(TIndex)));
            }

            if (indexMapping.Columns.IsEmpty())
            {
                indexMapping.AddDefaultColumn(new ColumnMapping {
                    Name = indexColumn
                });
            }

            return((T)this);
        }