public async Task <IActionResult> AddAccount([FromForm] AddAccountFormModel model) { var addingAccount = new AccountModel { // ReSharper disable once PossibleInvalidOperationException OwnerUserId = model.OwnerUserId.Value, // ReSharper disable once PossibleInvalidOperationException AccountTypeId = model.AccountTypeId.Value, Number = model.Number }; var account = await _accountService.AddAccountAsync(addingAccount); return(Json(account)); }
public AddAccountViewModel(IEnumerable <UserModel> users, IEnumerable <AccountTypeModel> accountTypes) { AddAccountFormModel = new AddAccountFormModel(users, accountTypes); }