public async Task <SongInventory> Import(string xml)
        {
            XmlRootAttribute xRoot = new XmlRootAttribute();

            xRoot.ElementName = "musicinventory";
            xRoot.IsNullable  = true;

            MusicVendorInventory musicVendorInventory = DeserializeObject <MusicVendorInventory>(xml, xRoot);

            XTimingSongInventoryMapper mapper = new XTimingSongInventoryMapper();

            return(await Task.FromResult(mapper.Map(musicVendorInventory)));
        }
Exemplo n.º 2
0
        public SongInventory Map(MusicVendorInventory musicVendorInventory)
        {
            SongInventory mi = new SongInventory();

            Dictionary <string, List <Song> > songMap = MapSongs(musicVendorInventory.Songs);

            var cat = MapCategories(musicVendorInventory.Categories, songMap);

            mi.Vendor    = MapVendor(musicVendorInventory.Vendor);
            mi.Inventory = cat;
            mi.DateTime  = DateTime.Now;

            return(mi);
        }