Ejemplo n.º 1
0
        public static List <VinylDTO> MapVinylList(List <Vinyl> vinyls)
        {
            List <VinylDTO> vinylsDTO = new List <VinylDTO>();

            foreach (Vinyl vinyl in vinyls)
            {
                VinylDTO newVinylDTO = Map(vinyl);
                vinylsDTO.Add(newVinylDTO);
            }

            return(vinylsDTO);
        }
Ejemplo n.º 2
0
        public static VinylDTO Map(IVinyl vinyl)
        {
            VinylDTO vinylDTO = new VinylDTO
            {
                ID      = vinyl.ID,
                Title   = vinyl.Title,
                Band    = vinyl.Band,
                Price   = vinyl.Price,
                InStock = vinyl.InStock
            };

            return(vinylDTO);
        }
Ejemplo n.º 3
0
        public async Task <bool> AddVinyl(VinylDTO vinyl)
        {
            IVinyl vinylObj = DTOMapper.Map(vinyl);

            return(await Task.FromResult(vinylDataBase.AddStock(vinylObj.ID, vinylObj.InStock)));
        }
Ejemplo n.º 4
0
 public async Task <bool> AddNewVinyl(VinylDTO vinyl)
 {
     return(await Task.FromResult(vinylDataBase.AddNew(DTOMapper.Map(vinyl))));
 }
Ejemplo n.º 5
0
        public static IVinyl Map(VinylDTO vinylDTO)
        {
            Vinyl vinyl = new Vinyl(vinylDTO.ID, vinylDTO.Title, vinylDTO.Band, vinylDTO.Price, vinylDTO.InStock);

            return(vinyl);
        }