using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MTWorkHR.Application.MappingProfiles { public class MapperObject { private static readonly Lazy Lazy = new Lazy(() => { var config = new MapperConfiguration(cfg => { cfg.ShouldMapProperty = p => p.GetMethod.IsPublic || p.GetMethod.IsAssembly; cfg.AddProfile(); }); var mapper = config.CreateMapper(); return mapper; }); public static IMapper Mapper => Lazy.Value; } }