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); }
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); }
public async Task <bool> AddVinyl(VinylDTO vinyl) { IVinyl vinylObj = DTOMapper.Map(vinyl); return(await Task.FromResult(vinylDataBase.AddStock(vinylObj.ID, vinylObj.InStock))); }
public async Task <bool> AddNewVinyl(VinylDTO vinyl) { return(await Task.FromResult(vinylDataBase.AddNew(DTOMapper.Map(vinyl)))); }
public static IVinyl Map(VinylDTO vinylDTO) { Vinyl vinyl = new Vinyl(vinylDTO.ID, vinylDTO.Title, vinylDTO.Band, vinylDTO.Price, vinylDTO.InStock); return(vinyl); }