Exemplo n.º 1
0
        private Inventory CreateInventory(string name, StructureInfo structureInfo)
        {
            var inventory = _inventoryService.Get(name.Replace(" ", ""));

            if (inventory != null)
            {
                return(inventory);
            }

            inventory = new Inventory {
                Id = name.Replace(" ", "")
            };
            foreach (var language in Solution.Instance.Languages)
            {
                inventory.Localizations[language.Culture].Name = name;
            }

            _inventoryService.Create(inventory);
            structureInfo.Mappings.Add(structureInfo.ProductCatalog.Inventory.SystemId, inventory.SystemId);
            return(inventory);
        }
Exemplo n.º 2
0
        public ActionResult <Inventory> Create(Inventory inventory)
        {
            _inventoryService.Create(inventory);

            return(CreatedAtRoute("GetInventory", new { id = inventory.Id.ToString() }, inventory));
        }
 public Inventory Create(Inventory entity)
 => inventoryService.Create(entity);