Ejemplo n.º 1
0
        private void LoadStandardMappings()
        {
            var mapsFrom = MapperProfileHelper.LoadStandardMappings(Assembly.GetExecutingAssembly());

            foreach (var map in mapsFrom)
            {
                CreateMap(map.Source, map.Destination).ReverseMap();
            }
        }
Ejemplo n.º 2
0
        private void LoadCustomMappings()
        {
            var mapsFrom = MapperProfileHelper.LoadCustomMappings(Assembly.GetExecutingAssembly());

            foreach (var map in mapsFrom)
            {
                map.CreateMappings(this);
            }
        }
Ejemplo n.º 3
0
        private void LoadCustomMappings()
        {
            var mapsFrom = MapperProfileHelper.LoadCustomMappings(Assembly.GetExecutingAssembly());

            foreach (var map in mapsFrom)
            {
                map.CreateMappings(this);
            }

            var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == "Northwind.Application.Commands");

            mapsFrom = MapperProfileHelper.LoadCustomMappings(assembly);
            foreach (var map in mapsFrom)
            {
                map.CreateMappings(this);
            }

            assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == "Northwind.Application.Queries");
            mapsFrom = MapperProfileHelper.LoadCustomMappings(assembly);
            foreach (var map in mapsFrom)
            {
                map.CreateMappings(this);
            }
        }