Ejemplo n.º 1
0
        public OneToManyObjectToObjectMap <TDest> MapFrom <TSource>(Expression <Func <TDest, object> > destinationExpression,
                                                                    string sourceExpression)
        {
            var newMapping = new ObjectToObjectMapping(typeof(TDest),
                                                       typeof(TSource),
                                                       ReflectionUtil.GetPropertyChain(destinationExpression),
                                                       sourceExpression);

            DoAdd(newMapping);
            return(this);
        }
Ejemplo n.º 2
0
 private void DoAdd(ObjectToObjectMapping newMapping)
 {
     Check.Require(!_mappings.Contains(newMapping),
                   string.Format("Cannot add duplicate mapping. Attempted: {0}", newMapping));
     _mappings.Add(newMapping);
 }