示例#1
0
        public IActionResult CreateUser(int userId, int itemId)
        {
            var result = new UserAndInventoriyRelationship {
                UserId = userId, InventoriyId = itemId
            };

            _context.UserAndInventoriyRelationship.Add(result);
            _context.SaveChanges();
            return(RedirectToAction("InventoryList", "Inventory"));
        }
示例#2
0
        public IActionResult CreateItem(int userId, int itemId)
        {
            var result = new UserAndInventoriyRelationship {
                UserId = userId, InventoriyId = itemId
            };

            _context.UserAndInventoriyRelationship.Add(result);
            _context.SaveChanges();
            return(RedirectToAction(nameof(Inventory), new { id = userId }));
        }