0
喜用的ICollection我学习使用MVC使用代码第一种方法。我无法理解使用我的设置使用ICollection <>。我有两个类/实体来说:“餐厅” &“RestaurantReview”如下:与MVC与实体框架
public class Restaurant
{
public int Id { get; set; }
public string Name { get; set; }
public string City { get; set; }
public string Country { get; set; }
public ICollection<RestaurantReview> Reviews { get; set; }
}
和.....
public class RestaurantReview
{
public int Id { get; set; }
public int Rating { get; set; }
public string Body { get; set; }
public string ReviewerName { get; set; }
public int RestaurantId { get; set; }
}
现在什么困惑我是餐厅类的最后一个属性。为什么它是'ICollection'类型,并使用我的RestaurantReview类作为参数,它是做什么的,希望我 已经使我自己清楚