Archive for the ‘SubSonic’ Category

I want my foreign key to be mapped to a single object and not a collection

Say you have two tables:  Teams and Registrations
Registration has a foreign key for Teams :

In Subsonic 3, the Registration class will have a property called “Beach_Teams” which returns a IQueryable<Beach_Team> collection.
If we look at the generate class in the activerecord.cs file, there is a “Foreign Keys” region which contains the Beach_Teams property:

#region ‘ Foreign [...]

More »

Subsonic : Specify the tables you really need !

With the Subsonic’s T4 Templates you can specify the tables you don’t want the access code to be generated.
But what if you want to choose the tables for which the mapping classes will be created ?
Actually you can have many reasons to do that : having an application using only specific tables from a big [...]

More »

Custom paging with Subsonic 3 and ObjectDataSource in ASP.NET

Here is how I created a paged items list in ASP.NET 3.5 using Subsonic for data access, and ASP.NET Controls for the display.
I use Subsonic 3.0.0.4 with ActiveRecord and ASP.NET 3.5 SP1 webforms.
For this example, we are creating a blog post list and that the DAL is created (the data class we use is “DAL.BlogPost”).
The [...]

More »