コード例 #1
0
        public async Task <IActionResult> GetComputer(int id)
        {
            var computer = await _repo.GetComputer(id);

            //var computersReturn = _mapper.Map<IEnumerable<ComputerForShowDto>>(computer);
            return(Ok(computer));
        }
コード例 #2
0
        public async Task <bool> UpdateInventory(Computer computer)
        {
            var computerFromRepo = await _repo.GetComputer(computer.Id);

            computerFromRepo.Inventory = new string("1-" + computerFromRepo.Id);
            return(await _repo.SaveAll());
        }