Exemplo n.º 1
0
 public IActionResult Update([FromBody] DBLoan loan)
 {
     if (ModelState.IsValid)
     {
         this.dataAccessProvider.UpdateRecord(loan);
         return(Ok());
     }
     return(BadRequest());
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 public void UpdateRecord(DBLoan loan)
 {
     this._context.loans.Update(loan);
     this._context.SaveChanges();
 }
Exemplo n.º 4
0
 public void CreateRecord(DBLoan loan)
 {
     this._context.loans.Add(loan);
     this._context.SaveChanges();
 }