Esempio n. 1
0
        public MapaRepositoryDto FindBy(string fileName, string name)
        {
            var engine = new FileHelperEngine <RotaRepositoryDto>();
            IList <RotaRepositoryDto> rotas = engine.ReadFile(fileName);

            var mapa = new MapaRepositoryDto();

            mapa.NomeMapa = name;
            mapa.Rotas    = rotas.ExpandListaRotasRepositoryDto();

            return(mapa);
        }
        public static MapaRepositoryDto ConvertoToMapaRepositoryDto(this Mapa mapa)
        {
            var mapaDto = new MapaRepositoryDto();

            //mapaDto.Id = mapa.Id.ToString();
            mapaDto.NomeMapa = mapa.NomeMapa;

            if (mapa.Rotas.Count > 0)
            {
                mapaDto.Rotas = mapa.Rotas.ConvertToListRotasDto();
            }

            return(mapaDto);
        }
        public static Mapa ConvertToMapa(this MapaRepositoryDto mapaRepositoryDto)
        {
            var mapa = new Mapa();

            //if(!string.IsNullOrEmpty(mapaDto.Id))
            //    mapa.Id = Guid.Parse(mapaDto.Id);

            mapa.NomeMapa = mapaRepositoryDto.NomeMapa;

            if (mapaRepositoryDto.Rotas.Count > 0)
            {
                mapa.Rotas = mapaRepositoryDto.Rotas.ConvertToListRotas();
            }

            return(mapa);
        }