public static EndingStatementBalance Create(EndingStatementBalanceAddModel model, string userId) { var endingStatementBalance = new EndingStatementBalance { BankAccountId = model.BankAccountId, EndingBalanceDate = model.EndingBalanceDate, EndingBalanceAmount = model.EndingBalanceAmount }; return(endingStatementBalance); }
public async Task <IActionResult> Add([FromBody] EndingStatementBalanceAddModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorList())); } try { await _manager.AddAsync(model); } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok()); }
public async Task AddAsync(EndingStatementBalanceAddModel model) { await _repository.AddAsync(EndingStatementBalanceFactory.Create(model, _userId)); await _unitOfWork.SaveChangesAsync(); }