This is really stupid, but it seems like enough of a stupid niche problem that it might be worth mentioning. There's an integer column in a database that maps to an enum. Whenever I tried to mark that enum as a column, I got an InvalidCastException (from deep within the Linq reflection-magic call...