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); }
private void DoAdd(ObjectToObjectMapping newMapping) { Check.Require(!_mappings.Contains(newMapping), string.Format("Cannot add duplicate mapping. Attempted: {0}", newMapping)); _mappings.Add(newMapping); }