Пример #1
0
        public async Task <ActionResult> AccountList()
        {
            if (Session["Account"] == null || (Session["Account"] as Account).Role != RoleUser.Admin)
            {
                return(Redirect("/"));
            }
            var accounts = await _account.GetAllAsync();

            return(View("~/Areas/Admin/Views/AccountAdmin/AccountList.cshtml", accounts));
        }
Пример #2
0
        public async Task <IActionResult> Get()
        {
            var result = await _accountService.GetAllAsync();

            return(Ok(result));
        }
Пример #3
0
 public async Task <IEnumerable <GetAllAccountResponse> > GetAllAsync()
 {
     using (_unitOfWorkFactory.StartUnitOfWork())
         return(_mapper.Map <List <GetAllAccountResponse> >(
                    await _accountService.GetAllAsync()));
 }