public async Task <ActionResult> Create(ClientCreateModel model) { if (ModelState.IsValid) { CreateClientCommand createClientCommand = model.ToCreateClientCommand(); createClientCommand.CreatedBy = User.Identity.Name; createClientCommand.CreatedOn = DateTime.Now; int result = await Mediator.Send(createClientCommand); if (result > 0) { return(View("List")); } else { ModelState.AddModelError("", "Thêm Client thất bại"); } } model.AvailableClaims = await GetClaims(); model.AvailableScopes = await GetScopes(); model.InitData(); return(View(model)); }