Developer Blog Search

Monday 12 May 2008

LINQ to SQL bug?

hmm, I have only noticed this in Web Developer Express Edition but it may be present in other versions.

Basically, it happens when you are mapping a field in one of your classes to an enum (using the LINQ to SQL editor).

  1. add a table with an int field
  2. change int field to enum name
  3. save

this works fine! now I go in and change something in the LINQ to SQL file - pretty much anything from what I can tell, add something, change a property, etc.

once done I rebuild and get a validation error for the dbml file. if I change the mapping back to int, save, change back to my enum, save, it works again. until the next time I have to change something on the model! rather annoying bug!

that is the only way around it I know of. Anyone who knows more about this than me please comment because it's driving me crazy!

No comments: