I am using Linq to Sql to query a number of database tables. In these tables there are a good few uses of the Image data type.
When using the DBML designer I drag and drop my tables, and any fields that use the Image data type are mapped as System.Data.Linq.Binary when the classes are generated. However, I want these to be Byte[].
Currently, this is a manual process or changing the field type in the designer, and in all fairness is not that time consuming in the grand scale of things, but I would prefer if this was done automatically for me.
Is there a way that this can be done? Some sort of Linq to Sql setting?
The main annoyance for me is when I make changes to a table that I need to re-add, and then I have to change the fields back to byte[]
The T4 Toolbox has a template that generates linq-to-SQL classes from the DBML that is easily customized, including changing the default type mappings.