예제 #1
0
        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));
        }
예제 #2
0
 public AddAccountViewModel(IEnumerable <UserModel> users, IEnumerable <AccountTypeModel> accountTypes)
 {
     AddAccountFormModel = new AddAccountFormModel(users, accountTypes);
 }