I'm working on my first asp.net 2.0 app (at least for work). I found the easiest way was to create an adapter for the repository methods.
I created an XXXRepositoryAdapter in my app_code folder with a default constructor, then wrapped the methods I needed to make my GridView work,
[DataObject]
class XXXRepositoryAdapter{
public XXXRepositoryAdapter(){}
public Collection GetAll(){
return Repository.Provider.GetAll();
}
GetBy..
Update..
Delete..
...
}
This worked well, I just created the methods that I needed. Anything more than the basic CRUD, you're probably better off to code it into the ObjectDataSource / Grid events.
I think for long term, we might need to create our own ObjectDataSource control. I read an article couple of months ago about it, but can't find it now.
Thanks,
John Teague
------------------------------
Member of the .NetTiers team
http://www.nettiers.com
------------------------------