コード例 #1
0
        public async Task <IActionResult> Index()
        {
            IdentityUser user = await _userManager.GetUserAsync(HttpContext.User);

            IEnumerable <GrupoIndexDTO> grupoIndexDTOs = await _grupoService.GetAllAsync(user.Id);

            return(View(grupoIndexDTOs));
        }
コード例 #2
0
        public async Task <ActionResult <IList <Grupo> > > GetAsync()
        {
            try
            {
                var grupos = await _service.GetAllAsync();

                return(new OkObjectResult(grupos));
            }
            catch (Exception ex)
            {
                return(new BadRequestObjectResult(ex));
            }
        }