Boo & Active Record makes for strange bedfellows

time to read 2 min | 304 words

Just check out the syntax to declare a property that is also a primary key:

[Boo.Lang.Property(UserId, Attributes:[PrimaryKey(PrimaryKeyType.Native, "id")])]

userId as int

The probably proper way to do it would be to ignore the magic Boo.Lang.Property attribute and do it the old fashion way:

userId as int

[PrimaryKey(PrimaryKeyType.Native, "id")]
UserId:
   get:
      return userId
   set:
      userId = value

But I find there to be something perversely elegant in the first version.

Update: Thanks to Jake for the grammer correction.