コード例 #1
0
        public IMapBuilderContext <TResult> MapProperty <TMember>(Expression <Func <TResult, TMember> > propertySelector, Action <IMapBuilderContextMap> configure)
        {
            var property = ExtractPropertyInfo(propertySelector);
            var mapping  = new PropertyMapping(new MappingSource(property, this.mappings.Count));

            if (null != configure)
            {
                var map = new MapBuilderContextMap(mapping);
                configure(map);
            }

            this.mappings[property] = mapping;

            return(this);
        }
コード例 #2
0
        public IMapBuilderContext <TResult> MapProperty(PropertyInfo propertyInfo, Action <IMapBuilderContextMap> configure)
        {
            if (null == propertyInfo)
            {
                throw new ArgumentNullException("propertyInfo");
            }

            var mapping = new PropertyMapping(new MappingSource(propertyInfo, this.mappings.Count));

            if (null != configure)
            {
                var map = new MapBuilderContextMap(mapping);
                configure(map);
            }

            this.mappings[propertyInfo] = mapping;

            return(this);
        }