Ejemplo n.º 1
0
        public async Task <ItemMasterCommand> InsertItemMasterCommand(ItemMasterCommand itemMasterCommand)
        {
            await _context.ItemMasterCommands.AddAsync(itemMasterCommand);// _repo.Add(itemMasterCommand);

            await _context.SaveChangesAsync();

            return(itemMasterCommand);
        }
Ejemplo n.º 2
0
        public async Task <ItemMasterCommand> UdateItemMasterCommand(ItemMasterCommand itemMasterCommand)
        {
            var imc = _context.ItemMasterCommands.Find(itemMasterCommand.ItemMasterCommandId);

            if (imc == null)
            {
                return(itemMasterCommand);
            }
            try
            {
                imc.Command = itemMasterCommand.Command;
                imc.Name    = itemMasterCommand.Name;
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(imc);
        }