I notice a lot of the examples for ASP.NET use Linq2Sql as the datasource.
Are there any examples out there which show how do use model binding with a non-Linq2Sql datasource, ie a dataset, or (as in my case) a generic list/collection of items based on a custom business object? i.e.
public class WebsiteList : List<Website>
{
public WebsiteList()
{
}
}
ASP.NET MVC is great, especially for its “use whatever you want” approach. It’s just a shame that so many examples are using Linq2Sql.
A lot of the examples you can use by replacing the Linq2Sql part with your own custom repository. Since it’s IQueryable you can replace it with “WebsiteList.AsQueryable()” and use most of the examples as is. For instance, here’s a dummy repository I use:
I can swap this out easily with the real repository (which may be Linq2Sql, ADO.NET Entities, SubSonic, …).