예제 #1
0
        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();
        }
예제 #2
0
        public async Task AddLogin(Logins login)
        {
            await _dbContext.AddAsync(login);

            await _dbContext.SaveChangesAsync();
        }
예제 #3
0
        public async Task AddBook(Library book)
        {
            await _dbContext.AddAsync(book);

            await _dbContext.SaveChangesAsync();
        }