Ejemplo n.º 1
0
        // GET: Players
        public async Task <IActionResult> Index()
        {
            var viewModel = new PlayersIndexViewModel
            {
                Players = await _service.GetPlayers()
            };

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        // GET: Player
        public ActionResult Index()
        {
            var players  = _context.Users.Where(u => u.UserTypeId == UserType.Player).ToList();
            var counries = _context.Countries.ToList();
            var roles    = _context.Roles.ToList();
            var regions  = _context.Regions.ToList();

            var viewModel = new PlayersIndexViewModel()
            {
                Players   = players,
                Countries = counries,
                Regions   = regions,
                Roles     = roles
            };

            return(View(viewModel));
        }