public ClienteAppServiceTest() { var DomainToViewModelMappingProfile = new DomainToViewModelMappingProfile(); var configuration = new MapperConfiguration(cfg => cfg.AddProfile(DomainToViewModelMappingProfile)); mapper = new Mapper(configuration); }
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)); }
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"))); }
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)); }
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"))); }
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(); }
public static void Map(DomainToViewModelMappingProfile profile) { profile.CreateMap <Cliente, CadastroViewModel>(); }
public static void Map(DomainToViewModelMappingProfile profile) { profile.CreateMap <Usuario, UsuarioViewModel>(); }
public static void Map(DomainToViewModelMappingProfile profile) { }