您好,我有一个关于预订计划的问题。我希望会员能够租一部或多部电影。我的问题是我应该如何构建它,这样你就不能在租借时租借同一部电影。我应该在 Renting 类或其他东西中有一个名为 Avaliable 的变量作为布尔值吗?谢谢
public class Member
{
public virtual int MemberId { get; set; }
public virtual int Name { get; set; }
public virtual List<Rental> Rentals { get; set; }
}
public class Movie
{
public virtual int MovieId { get; set; }
public virtual string Name { get; set; }
}
public class Renting
{
public virtual int RentalId { get; set; }
public virtual int MovieId { get; set; }
public virtual Movie Movie { get; set; }
public virtual int MemberId { get; set; }
public virtual Member Member { get; set; }
public DateTime startDate { get; set; }
public DateTime endDate { get; set; }
public DateTime dueDate { get; set; }
}