In a recent post, Deepak describes how to generate enums using Linq to Sql and SqlMetal.
1. Generate dbml using SqlMetal.
2. Find reference columns in the dbml that will be used as enums in code. Change their type to the enum name.
3. Generate code using SqlMetal.
I find this pretty interesting, but there would need to be some kind of conventions or configuration to denote which tables will be used as enumerations in the code. I think the way to tackle this is to create a custom msbuild task that will replace the enums for you based on either an item group or an xml property. This whole thing could be wrapped up in msbuild and applied in a separate proj file or in the AfterBuild or BeforeBuild target of one of the projects.