Ejemplo n.º 1
0
        // GET: Loans/Create
        public ActionResult Create()
        {
            var books = Task.Run(() => _bookRepository.GetAllAsync()).Result;

            ViewBag.BookId = new SelectList(books, "ID", "Name");
            var borrowers = Task.Run(() => _borrowerRepository.GetAllAsync()).Result;

            ViewBag.BorrowerId = new SelectList(_mapper.Map <List <BorrowerOutputModel> >(borrowers), "ID", "Fullname");
            return(View());
        }
        // GET: api/Borrowers
        /// <summary>
        /// Pobranie informacji o wszystkich wypożyczających
        /// </summary>
        public async Task <IHttpActionResult> GetBorrowers()
        {
            var borrowers = await _borrowerRepository.GetAllAsync();

            return(Ok(_mapper.Map <List <BorrowerOutputModel> >(borrowers)));
        }
Ejemplo n.º 3
0
        // GET: Borrowers
        public async Task <ActionResult> Index()
        {
            var borrowers = await _borrowerRepository.GetAllAsync();

            return(View(borrowers));
        }