This is weird, I'm trying to initalize my ICollection with List in my constructor and this happens:
Schedules = new List<BookingSchedule>(); //OK
CateringItems = new List<CateringItem>(); //Not
The properties:
public virtual ICollection<BookingSchedule> Schedules { get; set; }
public virtual ICollection<BookedCateringItem> CateringItems { get; set; }
Error:
Error 1 Cannot implicitly convert type
'System.Collections.Generic.List<MyApp.Models.CateringItem>' to
'System.Collections.Generic.ICollection<MyApp.Models.BookedCateringItem>'.
An explicit conversion exists (are you missing a cast?)
I can't see the difference between the two. I'm going insane trying to figure this out. Any idea?