예제 #1
0
        internal static void ConfigureAutoMapper()
        {
            ProgramDataMapper.ConfigureAutoMapper();
            PaymentDataMapper.ConfigureAutoMapper();

            if (AutoMapper.Mapper.FindTypeMapFor <PlayerSeason, DTO.PlayerSeason>() == null)
            {
                AutoMapper.Mapper.CreateMap <PlayerSeason, DTO.PlayerSeason>()
                .ForMember(season => season.Programs, programs => programs.ResolveUsing <PlayerSeasonProgramsDTOResolver>())
                .ForMember(season => season.Payments, payments => payments.ResolveUsing <PlayerSeasonPaymentsDTOResolver>());
            }

            if (AutoMapper.Mapper.FindTypeMapFor <DTO.PlayerSeason, PlayerSeason>() == null)
            {
                AutoMapper.Mapper.CreateMap <DTO.PlayerSeason, PlayerSeason>();
            }

#if DEBUG
            AutoMapper.Mapper.AssertConfigurationIsValid();
#endif
        }
예제 #2
0
 static PaymentDataMapper()
 {
     PaymentDataMapper.ConfigureAutoMapper();
 }