public static Reconciliation Create(ReconciliationAddModel model, string userId) { var reconciliation = new Reconciliation { Id = model.Id, BankAccountId = model.BankAccountId, ReconciliationDate = model.ReconciliationDate, StatementBalance = model.StatementBalance, IcloseBalance = model.IcloseBalance, ReconciliationStatus = model.ReconciliationStatus, IsReconciliation = model.IsReconciliation }; return(reconciliation); }
public async Task <IActionResult> Add([FromBody] ReconciliationAddModel 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(ReconciliationAddModel model) { await _repository.AddAsync(ReconciliationFactory.Create(model, _userId)); await _unitOfWork.SaveChangesAsync(); }