public IActionResult Update([FromBody] DBLoan loan) { if (ModelState.IsValid) { this.dataAccessProvider.UpdateRecord(loan); return(Ok()); } return(BadRequest()); }
public IActionResult Create([FromBody] DBLoan loan) { if (ModelState.IsValid) { Guid obj = Guid.NewGuid(); loan.ID = obj.ToString(); this.dataAccessProvider.CreateRecord(loan); return(Ok()); } return(BadRequest()); }
public void UpdateRecord(DBLoan loan) { this._context.loans.Update(loan); this._context.SaveChanges(); }
public void CreateRecord(DBLoan loan) { this._context.loans.Add(loan); this._context.SaveChanges(); }