Entities with VS 2005

Posts   
 
    
pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 26-Jan-2006 18:09:27   

Ok folks...

I am working on trying to figure out the best (last painfull) way of using LLBLGEN code with VS 2005.

The idea is to use as much of the new ASP.Net data source stuff (ObjectDataSource) so we can use as much of the design time tools as possible.

What I have been doing is creating a "DAO" class for each entity. The DAO has properties on it that return an EntityCollection2 or the Entity. So an example for a CustomerEntity might be a CustomerDAO with methods such as:

GetById() GetByState() GetByRegion() etc...

Then, I point the ObjectDataSource to these classes/methods to get the data. One problem is, since the collections aren't strongly typed all of the drop downs don't work, so I have to manually enter the property names for column values, etc.

Is this the right approach? Any feed back would be great.


Frans?

Now, to version 2.0, I would assume that since it supports generics the collections I could return would be strongly typed which would allow more of the design time drop downs and such to work?

If I use the approach above will this work with what you are doing in 2.x? Or will there be objects/methods in 2.0 already inplace to replace my DAO objects?

Thanks, BOb

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 26-Jan-2006 18:22:16   

THe ObjectDataSource is broken in that it always creates a new object on postback, which means the changetracking info is lost. v2 will have an LLBLGenDataSource to solve this. I know it's a pain now, but there's little I can do at the moment to fix hte mess the ASP.NET team has created with ObjectDataSource.

The issue you run into is that the ObjectDataSource uses reflection to determine the properties of the objects returned. THis of course doesn't work with collections which implement ITypedList, like EntityCollection.

Frans Bouma | Lead developer LLBLGen Pro