Esempio n. 1
0
 //CREATE == insert
 public void CreateLoan(Loans loan)
 {
     //dbContext.LibraryItems.Attach(loan.LoanedItem);
     //dbContext.Students.Attach(loan.Student);
     dbContext.Loans.Add(loan);
     dbContext.SaveChanges();
 }
Esempio n. 2
0
 //Update
 public void UpdateLoan(Loans loan)
 {
     dbContext.Entry <Loans>(loan).State = EntityState.Modified;
     dbContext.SaveChanges();
 }