Hello,
Does anyone know if an API exists for Linq's DataContext generator? I reflected SqlMetal.exe, but every class was marked internal. I would like to generate a datacontext .cs like sqlmetal, but from my own assembly.
Thanks! James
Hello,
Does anyone know if an API exists for Linq's DataContext generator? I reflected SqlMetal.exe, but every class was marked internal. I would like to generate a datacontext .cs like sqlmetal, but from my own assembly.
Thanks! James
All the classes in SqlMetal are internal because they are designed for building classes for the LINQ to SQL pattern. If you are wanting to generate your own classes from your own assembly you'll need to write your own generator.
There are several ways to go about this:
I've been writing my own ORM using CodeDom and it's tricky to say the least. You need to write a lot of code to generate a little.
There aren't really many good examples I found for working with CodeDom other than reflecting others implementations and using the MSDN references for the various classes.