There is a model class called
Review
.ReviewModel
is used fromStoreModel
andMenu
model.
In StoreModel.cs
[Table ("Stores")]
public class StoreModel
{
[Key]
public int Id { get; set; }
public string StoreName { get; set; }
public string StoreShortDescription { get; set; }
public string StoreFullDescription { get; set; }
public string StoreAddress { get; set; }
public ICollection<MenuModel> Menus { get; set; }
public ICollection<ReviewModel> Reviews { get; set; }
public StoreModel ()
{
Menus = new Collection<MenuModel> ();
Reviews = new Collection<ReviewModel> ();
}
}
in MenuModel.cs
[Table ("Menus")]
public class MenuModel
{
[Key]
public int Id { get; set; }
public string MenuName { get; set; }
public string MenuShortDescription { get; set; }
public string MenuThumbnailUrl { get; set; }
public int MenuPrice { get; set; }
public ICollection<ReviewModel> MenuReviews { get; set; }
public MenuModel ()
{
MenuReviews = new Collection<ReviewModel> ();
}
}
In this case, how should I implement this?
- Create a base
ReviewModel
class and have 2 subclass (StoreReview
,MenuModel
)
or
- Use
ReviewModel
for bothStoreModel
andMenuModel
(how?)
or
- thoughts?