Whack the following code in a .bat file, register it with Visual Studio’s “External Tools” under the Tools menu, and call it whenever you want to regenerate your LinqToSql ORM goodness:
@ECHO OFF
ECHO # GENERATING “MyProject.Classes.ORM” CLASSES – THEY MUST BE CHECKED OUT FOR THIS TO WORK!
ECHO.“C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SqlMetal.exe” /server:localhost /database:MyProjectDB /code:MyProject.Classes\ORM\MyProjectDBContext.cs /namespace:MyProject.Classes.ORM /pluralize
ECHO # GENERATION COMPLETE – CHECK ABOVE FOR ERRORS
Advertisement