2

I used sql metal to generate a c# entity file for the database that I'm using. The end result is a 6mb file with many entity classes inside, this takes a long time to load up in visual stuido. Is it possible to generate a single cs file per table/entity? Or is there utility that can split up the cs file into multiple source code files?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
setebos
  • 521
  • 1
  • 4
  • 10
  • 2
    I don't know of any "out-of-the-box" way to do this. But you could check out alternative ways to create your DBML file in the first place, like e.g. [PLINQO](http://www.codesmithtools.com/plinqo) which creates one file per class (if you wish that) – marc_s Jul 10 '11 at 17:30
  • 1
    Why do you care how long it takes to load up that file? You should never be modifying it anyway, so why do you need to open it? – Kirk Woll Jul 10 '11 at 17:33
  • 1
    I dont necessarily need to edit the file, I just view it to check relationships and the members of entities. Although I did consider adding annotations to the entities for use with mvc, I dont think I will be going down that route any longer... – setebos Jul 12 '11 at 00:27

1 Answers1

2

Not a direct answer, but a possible solution to your problem.

Move the entity file into its own project. Compile that and just use the reference to the assembly output in your main project file. Because it's generated code, you don't necessarily want to have it editable anyway.

This will allow the IDE to load the compiled version and make everything a bit snappier for development.

NotMe
  • 87,343
  • 27
  • 171
  • 245