﻿using System.Linq;
using AutoMapper;
using IObjectMapper = Abp.ObjectMapping.IObjectMapper;

namespace Abp.AutoMapper
{
    public class AutoMapperObjectMapper : IObjectMapper
    {
        private readonly IMapper _mapper;

        public AutoMapperObjectMapper(IMapper mapper)
        {
            _mapper = mapper;
        }

        public TDestination Map<TDestination>(object source)
        {
            return _mapper.Map<TDestination>(source);
        }

        public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
        {
            return _mapper.Map(source, destination);
        }

        public IQueryable<TDestination> ProjectTo<TDestination>(IQueryable source)
        {
            return _mapper.ProjectTo<TDestination>(source);
        }
    }
}

﻿using System.Linq;
using AutoMapper;
using IObjectMapper = Abp.ObjectMapping.IObjectMapper;

namespace Abp.AutoMapper
{
    public class AutoMapperObjectMapper : IObjectMapper
    {
        protected readonly IMapper _mapper;

        public AutoMapperObjectMapper(IMapper mapper)
        {
            _mapper = mapper;
        }

        public TDestination Map<TDestination>(object source)
        {
            return _mapper.Map<TDestination>(source);
        }

        public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
        {
            return _mapper.Map(source, destination);
        }

        public IQueryable<TDestination> ProjectTo<TDestination>(IQueryable source)
        {
            return _mapper.ProjectTo<TDestination>(source);
        }
    }
}

Change IMapper visibility from private to protected
Change IMapper visibility from private to protected

In order to simply the extension of the AutoMapperObjectMapper, this proposal want to promote the IMapper attribute to protected.
This allows to extend the IObjectMapper without realizing a new version of Abp.

See #4882 and #4885