コード例 #1
0
        // GET: Borrowers/Details/5
        public async Task <ActionResult> Details(int id)
        {
            Borrower borrower = await _borrowerRepository.GetByIdAsync(id);

            if (borrower == null)
            {
                return(HttpNotFound());
            }
            return(View(borrower));
        }
コード例 #2
0
        // GET: api/Borrowers/5
        /// <summary>
        /// Pobranie informacji wypożyczającego o podanym ID
        /// </summary>
        public async Task <IHttpActionResult> GetBorrower(int id)
        {
            Borrower borrower = await _borrowerRepository.GetByIdAsync(id);

            if (borrower == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <BorrowerOutputModel>(borrower)));
        }