コード例 #1
0
        public ClienteAppServiceTest()
        {
            var DomainToViewModelMappingProfile = new DomainToViewModelMappingProfile();
            var configuration = new MapperConfiguration(cfg => cfg.AddProfile(DomainToViewModelMappingProfile));

            mapper = new Mapper(configuration);
        }
コード例 #2
0
        public static void Map(DomainToViewModelMappingProfile profile)
        {
            profile.CreateMap <Usuario, CadastroViewModel>();

            profile.CreateMap <ArquivoUsuario, AnexoViewModel>()
            .ForMember(x => x.Arquivo, m => m.MapFrom(o => Convert.ToBase64String(o.Arquivo.Conteudo)))
            .ForMember(x => x.Nome, m => m.MapFrom(o => o.Arquivo.Nome));
        }
コード例 #3
0
 public static void Map(DomainToViewModelMappingProfile profile)
 {
     profile.CreateMap <Agendamento, CadastroViewModel>()
     .ForMember(x => x.Cliente, m => m.MapFrom(y => y.Cliente.Nome))
     .ForMember(x => x.Data, m => m.MapFrom(y => y.Data.ToString("dd/MM/yyyy")))
     .ForMember(x => x.DataNumero, m => m.MapFrom(y => y.Data.ToString("yyyy-MM-ddTHH:mm:ss")))
     .ForMember(x => x.HoraInicial, m => m.MapFrom(y => y.HoraInicial.ToString("HH:mm")))
     .ForMember(x => x.HoraFinal, m => m.MapFrom(y => y.HoraFinal.ToString("HH:mm")));
 }
コード例 #4
0
        public static void Map(DomainToViewModelMappingProfile profile)
        {
            profile.CreateMap <Clinica, ListagemViewModel>();

            profile.CreateMap <Clinica, CadastroViewModel>()
            .ForMember(x => x.IdUsuario, m => m.MapFrom(o => o.IdUsuario))
            .ForMember(x => x.Nome, m => m.MapFrom(o => o.Nome))
            .ForMember(x => x.Login, m => m.MapFrom(o => o.Usuario.Login))
            .ForMember(x => x.Senha, m => m.MapFrom(o => o.Usuario.Senha))
            .ForMember(x => x.Ativo, m => m.MapFrom(o => o.Usuario.Ativo));
        }
コード例 #5
0
        public static void Map(DomainToViewModelMappingProfile profile)
        {
            profile.CreateMap <Radiografia, CadastroViewModel>()
            .ForMember(x => x.Clinica, m => m.MapFrom(o => o.Clinica.Nome))
            .ForMember(x => x.Paciente, m => m.MapFrom(o => o.Paciente.Nome))
            .ForMember(x => x.Data, m => m.MapFrom(o => o.Data.ToString("dd/MM/yyyy")))
            .ForMember(x => x.Hora, m => m.MapFrom(o => o.Hora.ToString("HH:mm")));

            profile.CreateMap <Radiografia, ListagemViewModel>()
            .ForMember(x => x.Paciente, m => m.MapFrom(o => o.Paciente.Nome))
            .ForMember(x => x.Clinica, m => m.MapFrom(o => o.Clinica.Nome))
            .ForMember(x => x.Data, m => m.MapFrom(o => o.Data.ToString("dd/MM/yyyy")))
            .ForMember(x => x.Hora, m => m.MapFrom(o => o.Hora.ToString("HH:mm")));
        }
コード例 #6
0
        public void Setup()
        {
            var dmToVm     = new DomainToViewModelMappingProfile();
            var vmToDm     = new ViewModelToDomainMappingProfile();
            var mapperConf = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(dmToVm);
                cfg.AddProfile(vmToDm);
            });

            mapper = new Mapper(mapperConf);

            newsRepositoryMock = new Mock <INewsRepository>();
            newsRepositoryMock.SetupAllProperties();
        }
コード例 #7
0
 public static void Map(DomainToViewModelMappingProfile profile)
 {
     profile.CreateMap <Cliente, CadastroViewModel>();
 }
コード例 #8
0
 public static void Map(DomainToViewModelMappingProfile profile)
 {
     profile.CreateMap <Usuario, UsuarioViewModel>();
 }
コード例 #9
0
 public static void Map(DomainToViewModelMappingProfile profile)
 {
 }