Creating EntityView<> from IEntitiyCollection2

Posts   
 
    
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 10-Dec-2007 12:26:47   

Hi there,

Just checking: is there a way to create a new (not DefaultView) EntityView2 from IEntitiyCollection2?

arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 10-Dec-2007 16:08:35   

CreateView method

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 10-Dec-2007 17:08:43   

I don't see IEntityCollection2.CreateView method. Perhaps because I am (still) using v2.0?

arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 10-Dec-2007 17:42:19   

H'mmm. I am using 2.5 adapter.


IEntityCollection2 _yyyyMmInvoiceCollection;
...
IEntityView2 iev = _customerYyyyMmCollection.CreateView(filter);

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Dec-2007 18:41:10   

Reference manual -> ORMSupportClasses -> Interfaces -> IEntityCollection2 -> Methods -> CreateView.. (4 overloads) stuck_out_tongue_winking_eye

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 10-Dec-2007 21:33:56   

Otis wrote:

Reference manual -> ORMSupportClasses -> Interfaces -> IEntityCollection2 -> Methods -> CreateView.. (4 overloads) stuck_out_tongue_winking_eye

Nope. Not a single one. Because of v2.0?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Dec-2007 22:42:06   

You're still on v2.0? Then yes, it's not in v2.0. You then have to grab the generic argument for the IEntityCollection2 instance, (the T in EntityCollection<T>), and use Type.MakeGenericType() to create a new instance.

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 11-Dec-2007 08:33:39   

OK, no typed way then. About 2.0: yes, still on 2.0 because I modified a bunch of templates and added some low level behaviour. Switching to 2.0 for current project would require some amount of work which isn't necessary at this time because everything is working prety well.