Search code examples
.netlinq-to-sqlsqlmetal

LINQ to SQL: origins of EnumMapper.exe?


in this system I'm currently working on, the DataContext is being generated using SqlMetal via a process very similar to what's detailed here.

  1. Run SqlMetal.exe on database to generate a dbml file
  2. Run a console app on dbml file to replace specific ints with enums
  3. Run SqlMetal.exe again to generate code from dbml file

The problem is, we're using an executable called EnumMapper.exe to perform step #2, and it's not doing exactly what I want. I have no idea whether this is an app written in house with NO source code left anywhere, or it's a program found somewhere on the web. Extensive Googling has found me no leads other than the above link.

Has anyone ever heard of this mysterious EnumMapper.exe?


Solution

  • Sounds like a custom app. I've never heard of it. I'd open up the .exe in Reflector (assuming it's a .NET assembly) and see if there's any hints in the namespace or assembly attributes.

    LINQ to SQL does support enums but the DBML generator and designer do not, so this was likely done to make the entities easier to work with.