dbContext template and collections

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
chneumann
Posts: 1
Joined: Tue 23 Oct 2018 16:41

dbContext template and collections

Post by chneumann » Tue 23 Oct 2018 17:35

HI,
I have a need to have collections created as Lists as opposed to HashSets or ObservableCollections which seem to be the only two options. Based on other forum entries and the documentation, this is possible with the NHibernate template, but I do not see the same capability for the dbConext templates.

Is there a way to accomplish this?

Thanks,
Carl

Shalex
Site Admin
Posts: 8660
Joined: Thu 14 Aug 2008 12:44

Re: dbContext template and collections

Post by Shalex » Fri 26 Oct 2018 18:56

We are processing your request. We will contact you as soon as possible.

figueiredorj
Posts: 41
Joined: Fri 12 Apr 2013 19:05

Re: dbContext template and collections

Post by figueiredorj » Mon 29 Oct 2018 14:27

@chneumann,
by default dbcontext generates ICollection<>;
List is an implementation of it so you can safely cast to List<>.

Shalex
Site Admin
Posts: 8660
Joined: Thu 14 Aug 2008 12:44

Re: dbContext template and collections

Post by Shalex » Thu 08 Nov 2018 14:33

@figueiredorj,
Thank you for posting. Your answer is about EF Core.

@chneumann,
You are working with EF6, aren't you? The type ICollection<T> or ObservableCollection or ObservableListSource of collection property depends on the values of the following DbContext template properties: EnableWinFormsDataBinding, UseObservableCollection, ProxyCreationEnabled. Does this information help?

Post Reply