Subsonic 3.0 creates a byte array for a tinyint sql column

subsonic3

I was trying to use Subsonic to generate my DAL, but I noticed a bug while generating Classes using LinqToEntities T4 templates.
I noticed that one of the columns in a table was having the type tinyint, while generating a Property for this column it created one which returns a byte[] instead of a byte.

Also another Table had a Column named ModifiedBy with the type set to smallint. Subsonic created the Property in the class correctly as short however in one of the PropertyChanged methods it was expecting a string for this field and was setting its value to Environment.UserName.

Has anyone faced this issue before?
TIA..

Best Answer

you may have solved this by now but..

  • Search in the file SQLServer.ttinclude for "tinyint"
  • You'll see a C# switch statement
  • Modify the one for tinyint to something more useful, such as Integer

Worked for me