❔ Entity Framework. Rental list
I have a class for books and I have a class of customers. I also have a class for loans.
The books should be possible to be loaned by other customers as well but only after the loaner has given it back and the loaner can choose themselves how many days they want to loan the book, a maximum of a week though.
The loans class should be a junction table, I assume this is a many-to-many relation?
I can figure out the relation-stuff in EF but I'm unsure how to check the timespan between date1 and date2. It's of course of type DateTime. It seems like I can use calculus to calculate the datetimes but how would this look like with either Linq or with a lambda expression?
The books should be possible to be loaned by other customers as well but only after the loaner has given it back and the loaner can choose themselves how many days they want to loan the book, a maximum of a week though.
The loans class should be a junction table, I assume this is a many-to-many relation?
I can figure out the relation-stuff in EF but I'm unsure how to check the timespan between date1 and date2. It's of course of type DateTime. It seems like I can use calculus to calculate the datetimes but how would this look like with either Linq or with a lambda expression?
