コード例 #1
0
        public static ProblemaDto ConvertToProblemaDto(this Problema problema)
        {
            var problemaDto = new ProblemaDto();

            //Both used to find the map
            problemaDto.Id       = problema.Id;
            problemaDto.NomeMapa = problema.NomeMapa;

            problemaDto.Origem           = problema.Origem;
            problemaDto.Destino          = problema.Destino;
            problemaDto.AutonomiaVeiculo = problema.AutonomiaVeiculo.ToString();
            problemaDto.ValorCombustivel = problema.ValorCombustivel.ToString();

            return(problemaDto);
        }
コード例 #2
0
        public static Problema ConvertToProblema(this ProblemaDto problemaDto)
        {
            var problema = new Problema();

            //Both used to find the map
            problema.Id       = problemaDto.Id;
            problema.NomeMapa = problemaDto.NomeMapa;

            problema.Origem           = problemaDto.Origem;
            problema.Destino          = problemaDto.Destino;
            problema.AutonomiaVeiculo = decimal.Parse(problemaDto.AutonomiaVeiculo);
            problema.ValorCombustivel = decimal.Parse(problemaDto.ValorCombustivel);

            return(problema);
        }