public void Insert(BorrowRequestDetail entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     _entities.Add(entity);
     _context.SaveChanges();
 }
コード例 #2
0
 public void CreateBorrowRequestDetails(int borrowRequestId, BorrowRequestDTO borrowRequestDTO)
 {
     foreach (Book book in borrowRequestDTO.BorrowBooks)
     {
         var entityRequestDetails = new BorrowRequestDetail
         {
             BookId          = book.Id,
             BorrowRequestId = borrowRequestId,
         };
         _bDRepository.Insert(entityRequestDetails);
     }
 }