public Inventory GenerateInventory(int albumId) { var inventory = new Inventory(); var album = StoreDb.Albums.FirstOrDefault(x => x.AlbumId == albumId); if (album != null) { //Detials inventory.Details.Id = albumId; inventory.Details.Name = album.Title; //Warehouse for (var i = 0; i <= Random.Next(Warehouses.Count - 1); i++) { inventory.Warehouse.Add(new InventoryLocations { Name = Warehouses[i], Available = Random.Next(50), Backorder = Random.Next(30), Sold = Random.Next(40) }); } } return inventory; }
public InventoryDetail(Inventory root) { Root = root; }