Exemple #1
0
        public async Task <IActionResult> Create()
        {
            try
            {
                var people = await _peopleService.FindAllAsync();

                var product = await _productService.FindAllAsync();

                var viewModel = new OfferFormViewModels {
                    Peoples = people, Products = product
                };
                return(View(viewModel));
            }
            catch (Exception e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }
Exemple #2
0
        public async Task <IActionResult> Index()
        {
            var list = await _people.FindAllAsync();

            return(View(list));
        }