What is the best practice to define a One-to-Many relationship in EF Core?
Is it recommended to generally use lists, as these offer more functionalities? Then rather the interface IList instead of List, as it does not define the implementation? If it does matter, on what criteria should I pick one or the other?
Microsoft suggests the following https://learn.microsoft.com/en-us/ef/core/modeling/relationships
public class Blog
{
public int BlogId { get; set; }
public List<Post> Posts { get; set; }
}
public class Post
{
public int PostId { get; set; }
public int BlogId { get; set; }
public Blog Blog { get; set; }
}
Whereas
https://www.learnentityframeworkcore.com/configuration/one-to-many-relationship-configuration suggest ICollections
Is the following answer of 2011 still valid in EF Core?