コード例 #1
0
        public Library CheckInBook(Book b, DateTime returndate)
        {
            //var result = libraries.FirstOrDefault(x => x.Book.Id == b.Id && x.ExpectedReturnDate != null);
            var result = new Library();

            result.ExpectedReturnDate = null;
            result.ActualReturnDate = returndate;
            return result;
        }
コード例 #2
0
 public Library CheckOutBook(Book b, Student s, DateTime borrowdate)
 {
     var result = new Library();
     //if (libraries.Any())
     //{
     //    result.Id = libraries.Max(x => x.Id) + 1;
     //}
     //else
     //{
     //    result.Id = 1;
     //}
     //result.Book = b;
     //result.Student = s;
     result.BorrowDate = borrowdate;
     result.ExpectedReturnDate = borrowdate.AddMonths(1);
     //libraries.Add(result);
     return result;
 }