public async Task <IActionResult> Create() { try { ViewBag.Users = new SelectList(await _usersGRUD.GetAllAsync(), "Id", "Email"); ViewBag.DefaultUserEmail = null; } catch (Exception ex) { _logger.ErrorMessage(ex.Message); return(BadRequest()); } return(View()); }
public async Task <IActionResult> Index() { List <User> users = null; List <Report> reports = null; try { users = await _usersGRUD.GetAllAsync(); reports = await _reportsGRUD.GetAllAsync(); } catch (Exception ex) { _logger.ErrorMessage(ex.Message); return(BadRequest()); } IndexModelUserPerson usersAndPersons = new IndexModelUserPerson() { Reports = reports, Users = users }; return(View(usersAndPersons)); }