Пример #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);
 }