public async Task AddLoan(Loans loan) { var FindBook = _dbContext.Books.FirstOrDefault(d => d.BookId == loan.BookId); await _dbContext.Loans.AddAsync(loan); FindBook.AvailableBooks--; await _dbContext.SaveChangesAsync(); }
public async Task AddLogin(Logins login) { await _dbContext.AddAsync(login); await _dbContext.SaveChangesAsync(); }
public async Task AddBook(Library book) { await _dbContext.AddAsync(book); await _dbContext.SaveChangesAsync(); }