コード例 #1
0
        // ReSharper restore UnusedMember.Local

        private void InternalRegisterOneWayMappingAction <TFrom, TTo>(Action <IMappingCollection <TFrom, TTo, TContext> > overrides)
        {
            AssertIsNotInitialized();
            StackTrace stackTrace = null;

            if (_diagnosticsEnabled)
            {
                stackTrace = CaptureStackTrace();
            }
            RequireOneWayMap <TFrom, TTo>(stackTrace != null ? stackTrace.ToString() : "unknown");
            var map = new MapObject <TFrom, TTo, TContext>(this);

            AssertNoExistingMaps(typeof(TFrom), typeof(TTo));
            _maps.Add(map);
            if (_diagnosticsEnabled)
            {
                _mapCreationInfo.Add(new MapInfoEntry(map));
            }
            if (overrides != null)
            {
                map.AcceptOverrides(overrides);
            }
        }