Example #1
0
        public async Task <IActionResult> AddProfession(int id)
        {
            var user = await _authorizerService.Authorize(HttpContext);

            if (user == null)
            {
                return(Redirect(GlobalConstants.Default_Login_Page));
            }

            var race = _racesService.ById(id);

            if (race == null)
            {
                return(Redirect(Races_Root_Path));
            }

            var model = new AddProfessionToRaceInputModel
            {
                RaceId      = id,
                RaceName    = race.Name,
                Professions = _professionsService.All()
            };

            return(View(model));
        }
Example #2
0
        public IActionResult Index()
        {
            var model = _professionsService.All()?.ToList();

            return(View(model));
        }