Ejemplo n.º 1
0
        public async virtual Task <IActionResult> Create(int id)
        {
            if (id > 0)
            {
                logger.LogInformation($"Create, {id}");
                try
                {
                    User created = await uow.SignIntoTutorial(id);

                    return(RedirectToAction(nameof(Index), new { info = localizer["User signed into tutorial"] }));
                }
                catch (Exception ex)
                {
                    logger.LogError(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString());
                    return(RedirectToAction(nameof(Index), new { error = ex.Message }));
                }
            }
            return(RedirectToAction(nameof(Index), new { info = localizer["Tutorial id is not valid"] }));
        }