EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

EF Core: Provide guidance on what collection types to use

Open divega opened this issue 6 years ago • 3 comments

This is probably a subtopic in relationships.

EF Core is pretty flexible re the type of collection you use, so this is about describing what is supported and how to choose between all the types supported in different scenarios, like when you need an ordered list, data binding, lazy loading proxies, etc.

See the discussion in https://github.com/aspnet/EntityFramework.Docs/pull/1003.

divega avatar Oct 04 '18 01:10 divega

I noticed that contrary to #1003 the samples now seem to use List<T> in a lot of places (or all perhaps?). Any update on what should be used and when? Coming from EF6 and earlier EF Core versions I'm used to ICollection<T>, but on the other hand I think that mainly was a use case for lazy loading? I haven't been using lazy loading for ages, but it'd be good to have some documentation on the appropriate collection types to use.

mycroes avatar Feb 16 '24 08:02 mycroes

@mycroes Use whatever you prefer or has the characteristics you need.

ajcvickers avatar Feb 16 '24 09:02 ajcvickers