0

Title is pretty self explanatory. I would like to have my EF autogenerated partial classes to use List intead of ICollection.

PercivalMcGullicuddy
  • 5,263
  • 9
  • 46
  • 65
  • Which Template are you using to generate the classes? We're using Self Tracking Entities and the navigation properties are `TrackableCollection`, which derives from `ObservableCollection` – Federico Berasategui Feb 06 '13 at 14:45

2 Answers2

1

Yes, it is. I have done so many times. Are you having some problems generating it?

Ex: public virtual List<Property> Properties { get; set; }

Corey Adler
  • 15,897
  • 18
  • 66
  • 80
  • 1
    Agreed However I would advise you to use TrackableCollection instead of List, if you at all intend to use WPF at all. – Aron Feb 06 '13 at 15:58
  • Hi... I'm new on this and I'm having the same issue with Icollection... I need to change it for another collection type. I see the edmx properties, but i can't find where to change the collection type... or where to get another template... I'll appreciate your help! – Leo Mar 14 '15 at 08:57
0

No because when you hit .ToList() which will return a List EF will hit the database with the query so it's always better to cal .ToList at the end

Raffaeu
  • 6,694
  • 13
  • 68
  • 110