예제 #1
0
        public async Task <IActionResult> Login(LoginUserCommand command)
        {
            if (ModelState.IsValid)
            {
                var result = await _mediatr.SendAsync(command);

                if (result.Success)
                {
                    return(Redirect("/"));
                }
                ModelState.AddModelErrors(result.Errors);
            }
            return(View(command));
        }
예제 #2
0
        public IActionResult Login()
        {
            var model = new LoginUserCommand();

            return(View(model));
        }